diff --git a/FizzBuzz.playground/Contents.swift b/FizzBuzz.playground/Contents.swift new file mode 100644 index 0000000..0e3cb8f --- /dev/null +++ b/FizzBuzz.playground/Contents.swift @@ -0,0 +1,14 @@ +for i in 1...100 { + if i.isMultiple(of: 3) && i.isMultiple(of: 5){ + print("FizzBuzz") + } + else if i.isMultiple(of: 3) { + print("Fizz") + } + else if i.isMultiple(of: 5) { + print("Buzz") + } + else{ + print(i) + } +} diff --git a/FizzBuzz.playground/contents.xcplayground b/FizzBuzz.playground/contents.xcplayground new file mode 100644 index 0000000..cf026f2 --- /dev/null +++ b/FizzBuzz.playground/contents.xcplayground @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Splits/ChangeLogData.swift b/Splits/ChangeLogData.swift index d51bcae..fa3bb55 100644 --- a/Splits/ChangeLogData.swift +++ b/Splits/ChangeLogData.swift @@ -10,6 +10,18 @@ import SwiftUI struct April2022: View { var body: some View { ScrollView { + //2022-04-13 + HStack { + VStack (alignment: .leading) { + Text("2022-04-13") + .font(.title2) + Text("Version Prerelease Build LVSXT10j\n") + .font(.footnote) + Text("\u{2022} Started work on optimizing code. Made no other changes and left the code with errors.") + } + Spacer() + } + .padding(30) //2022-04-11 HStack { diff --git a/Splits/ContentView.swift b/Splits/ContentView.swift index a023cc4..9ba4e79 100644 --- a/Splits/ContentView.swift +++ b/Splits/ContentView.swift @@ -71,17 +71,25 @@ struct PaceResults: View { //var pacePerUnit = 0.0 //var notSelectedSystem = "" - let convertedSeconds = (Double(timeSeconds) ?? 0) * (1+(2/3)) - let timeSecondsInt = Int(timeSeconds) ?? 0 - let timeSecondsUnderSixty = (timeSecondsInt % 60) + func secondsConversion(timeSeconds: String) -> (timeSecondsInt: Int, timeSecondsUnderSixty: Int) { + let convertedSeconds = (Double(timeSeconds) ?? 0) * (1+(2/3)) + let timeSecondsInt = Int(timeSeconds) ?? 0 + let timeSecondsUnderSixty = (timeSecondsInt % 60) + return (timeSecondsInt, timeSecondsUnderSixty) + } - let timeSecondsToMinutes = (timeSecondsInt - timeSecondsUnderSixty) / 60 + func minutesConversion(secondsConversion) { + let timeSecondsToMinutes = (timeSecondsInt - timeSecondsUnderSixty) / 60 - let timeMinutesDouble = Double(timeMinutes) ?? 0.0 + let timeMinutesDouble = Double(timeMinutes) ?? 0.0 + + let timeMinutesInt = (Int(timeMinutes) ?? 0) + (timeSecondsToMinutes) + let timeMinutesUnderSixty = timeMinutesInt % 60 + let timeMinutesToHours = (timeMinutesInt - timeMinutesUnderSixty) / 60 + + return (timeMinutesUnderSixty, timeMinutesDouble, timeMinutesToHours) + } - let timeMinutesInt = (Int(timeMinutes) ?? 0) + (timeSecondsToMinutes) - let timeMinutesUnderSixty = timeMinutesInt % 60 - let timeMinutesToHours = (timeMinutesInt - timeMinutesUnderSixty) / 60 let leadingZeros = String(format: "%02d:%02d", timeMinutesUnderSixty, timeSecondsUnderSixty)