File tree Expand file tree Collapse file tree 9 files changed +27
-54
lines changed
day06/src/main/kotlin/games
day10/src/main/kotlin/games
day14/src/main/kotlin/games
day17/src/main/kotlin/games
day02/src/main/kotlin/games
day06/src/main/kotlin/games
day10/src/main/kotlin/games
day14/src/main/kotlin/games
day17/src/main/kotlin/games Expand file tree Collapse file tree 9 files changed +27
-54
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,6 @@ package games
22
33private const val MIN = 0
44private const val MAX = 100
5- private const val FIZZBUZZ = 15
6- private const val FIZZ = 3
7- private const val BUZZ = 5
85
96object FizzBuzz {
107 fun convert (input : Int ): String {
@@ -14,9 +11,9 @@ object FizzBuzz {
1411
1512 private fun convertSafely (input : Int ): String {
1613 return when {
17- `is `(FIZZBUZZ , input) -> " FizzBuzz"
18- `is `(FIZZ , input) -> " Fizz"
19- `is `(BUZZ , input) -> " Buzz"
14+ `is `(15 , input) -> " FizzBuzz"
15+ `is `(3 , input) -> " Fizz"
16+ `is `(5 , input) -> " Buzz"
2017 else -> input.toString()
2118 }
2219 }
Original file line number Diff line number Diff line change @@ -2,9 +2,6 @@ package games
22
33private const val MIN = 0
44private const val MAX = 100
5- private const val FIZZBUZZ = 15
6- private const val FIZZ = 3
7- private const val BUZZ = 5
85
96object FizzBuzz {
107 fun convert (input : Int ): String {
@@ -14,9 +11,9 @@ object FizzBuzz {
1411
1512 private fun convertSafely (input : Int ): String {
1613 return when {
17- `is `(FIZZBUZZ , input) -> " FizzBuzz"
18- `is `(FIZZ , input) -> " Fizz"
19- `is `(BUZZ , input) -> " Buzz"
14+ `is `(15 , input) -> " FizzBuzz"
15+ `is `(3 , input) -> " Fizz"
16+ `is `(5 , input) -> " Buzz"
2017 else -> input.toString()
2118 }
2219 }
Original file line number Diff line number Diff line change @@ -2,9 +2,6 @@ package games
22
33private const val MIN = 0
44private const val MAX = 100
5- private const val FIZZBUZZ = 15
6- private const val FIZZ = 3
7- private const val BUZZ = 5
85
96object FizzBuzz {
107 fun convert (input : Int ): String {
@@ -14,9 +11,9 @@ object FizzBuzz {
1411
1512 private fun convertSafely (input : Int ): String {
1613 return when {
17- `is `(FIZZBUZZ , input) -> " FizzBuzz"
18- `is `(FIZZ , input) -> " Fizz"
19- `is `(BUZZ , input) -> " Buzz"
14+ `is `(15 , input) -> " FizzBuzz"
15+ `is `(3 , input) -> " Fizz"
16+ `is `(5 , input) -> " Buzz"
2017 else -> input.toString()
2118 }
2219 }
Original file line number Diff line number Diff line change @@ -6,9 +6,6 @@ import arrow.core.Some
66
77private const val MIN = 0
88private const val MAX = 100
9- private const val FIZZBUZZ = 15
10- private const val FIZZ = 3
11- private const val BUZZ = 5
129
1310object FizzBuzz {
1411 fun convert (input : Int ): Option <String > = when {
@@ -17,9 +14,9 @@ object FizzBuzz {
1714 }
1815
1916 private fun convertSafely (input : Int ): String = when {
20- `is `(FIZZBUZZ , input) -> " FizzBuzz"
21- `is `(FIZZ , input) -> " Fizz"
22- `is `(BUZZ , input) -> " Buzz"
17+ `is `(15 , input) -> " FizzBuzz"
18+ `is `(3 , input) -> " Fizz"
19+ `is `(5 , input) -> " Buzz"
2320 else -> input.toString()
2421 }
2522
Original file line number Diff line number Diff line change @@ -2,9 +2,6 @@ package games
22
33private const val MIN = 0
44private const val MAX = 100
5- private const val FIZZBUZZ = 15
6- private const val FIZZ = 3
7- private const val BUZZ = 5
85
96object FizzBuzz {
107 fun convert (input : Int ): String {
@@ -14,9 +11,9 @@ object FizzBuzz {
1411
1512 private fun convertSafely (input : Int ): String {
1613 return when {
17- `is `(FIZZBUZZ , input) -> " FizzBuzz"
18- `is `(FIZZ , input) -> " Fizz"
19- `is `(BUZZ , input) -> " Buzz"
14+ `is `(15 , input) -> " FizzBuzz"
15+ `is `(3 , input) -> " Fizz"
16+ `is `(5 , input) -> " Buzz"
2017 else -> input.toString()
2118 }
2219 }
Original file line number Diff line number Diff line change @@ -2,16 +2,13 @@ package games
22
33private const val MIN = 0
44private const val MAX = 100
5- private const val FIZZBUZZ = 15
6- private const val FIZZ = 3
7- private const val BUZZ = 5
85
96object FizzBuzz {
107 fun convert (input : Int ): String = when {
118 isOutOfRange(input) -> throw OutOfRangeException ()
12- `is `(FIZZBUZZ , input) -> " FizzBuzz"
13- `is `(FIZZ , input) -> " Fizz"
14- `is `(BUZZ , input) -> " Buzz"
9+ `is `(15 , input) -> " FizzBuzz"
10+ `is `(3 , input) -> " Fizz"
11+ `is `(5 , input) -> " Buzz"
1512 else -> input.toString()
1613 }
1714
Original file line number Diff line number Diff line change @@ -2,16 +2,13 @@ package games
22
33private const val MIN = 0
44private const val MAX = 100
5- private const val FIZZBUZZ = 15
6- private const val FIZZ = 3
7- private const val BUZZ = 5
85
96object FizzBuzz {
107 fun convert (input : Int ): String = when {
118 isOutOfRange(input) -> throw OutOfRangeException ()
12- `is `(FIZZBUZZ , input) -> " FizzBuzz"
13- `is `(FIZZ , input) -> " Fizz"
14- `is `(BUZZ , input) -> " Buzz"
9+ `is `(15 , input) -> " FizzBuzz"
10+ `is `(3 , input) -> " Fizz"
11+ `is `(5 , input) -> " Buzz"
1512 else -> input.toString()
1613 }
1714
Original file line number Diff line number Diff line change @@ -6,9 +6,6 @@ import arrow.core.Some
66
77private const val MIN = 0
88private const val MAX = 100
9- private const val FIZZBUZZ = 15
10- private const val FIZZ = 3
11- private const val BUZZ = 5
129
1310object FizzBuzz {
1411 fun convert (input : Int ): Option <String > = when {
@@ -17,9 +14,9 @@ object FizzBuzz {
1714 }
1815
1916 private fun convertSafely (input : Int ): String = when {
20- `is `(FIZZBUZZ , input) -> " FizzBuzz"
21- `is `(FIZZ , input) -> " Fizz"
22- `is `(BUZZ , input) -> " Buzz"
17+ `is `(15 , input) -> " FizzBuzz"
18+ `is `(3 , input) -> " Fizz"
19+ `is `(5 , input) -> " Buzz"
2320 else -> input.toString()
2421 }
2522
Original file line number Diff line number Diff line change @@ -6,9 +6,6 @@ import arrow.core.Some
66
77const val MIN = 1
88const val MAX = 100
9- private const val FIZZBUZZ = 15
10- private const val FIZZ = 3
11- private const val BUZZ = 5
129
1310object FizzBuzz {
1411 fun convert (input : Int ): Option <String > = when {
@@ -17,9 +14,9 @@ object FizzBuzz {
1714 }
1815
1916 private fun convertSafely (input : Int ): String = when {
20- `is `(FIZZBUZZ , input) -> " FizzBuzz"
21- `is `(FIZZ , input) -> " Fizz"
22- `is `(BUZZ , input) -> " Buzz"
17+ `is `(15 , input) -> " FizzBuzz"
18+ `is `(3 , input) -> " Fizz"
19+ `is `(5 , input) -> " Buzz"
2320 else -> input.toString()
2421 }
2522
You can’t perform that action at this time.
0 commit comments