Skip to content

Commit ee82360

Browse files
committed
remove fizzbuzz const in kt
1 parent 158a566 commit ee82360

File tree

9 files changed

+27
-54
lines changed

9 files changed

+27
-54
lines changed

exercise/kotlin/day06/src/main/kotlin/games/FizzBuzz.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ package games
22

33
private const val MIN = 0
44
private const val MAX = 100
5-
private const val FIZZBUZZ = 15
6-
private const val FIZZ = 3
7-
private const val BUZZ = 5
85

96
object 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
}

exercise/kotlin/day10/src/main/kotlin/games/FizzBuzz.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ package games
22

33
private const val MIN = 0
44
private const val MAX = 100
5-
private const val FIZZBUZZ = 15
6-
private const val FIZZ = 3
7-
private const val BUZZ = 5
85

96
object 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
}

exercise/kotlin/day14/src/main/kotlin/games/FizzBuzz.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ package games
22

33
private const val MIN = 0
44
private const val MAX = 100
5-
private const val FIZZBUZZ = 15
6-
private const val FIZZ = 3
7-
private const val BUZZ = 5
85

96
object 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
}

exercise/kotlin/day17/src/main/kotlin/games/FizzBuzz.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ import arrow.core.Some
66

77
private const val MIN = 0
88
private const val MAX = 100
9-
private const val FIZZBUZZ = 15
10-
private const val FIZZ = 3
11-
private const val BUZZ = 5
129

1310
object 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

solution/kotlin/day02/src/main/kotlin/games/FizzBuzz.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ package games
22

33
private const val MIN = 0
44
private const val MAX = 100
5-
private const val FIZZBUZZ = 15
6-
private const val FIZZ = 3
7-
private const val BUZZ = 5
85

96
object 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
}

solution/kotlin/day06/src/main/kotlin/games/FizzBuzz.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@ package games
22

33
private const val MIN = 0
44
private const val MAX = 100
5-
private const val FIZZBUZZ = 15
6-
private const val FIZZ = 3
7-
private const val BUZZ = 5
85

96
object 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

solution/kotlin/day10/src/main/kotlin/games/FizzBuzz.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@ package games
22

33
private const val MIN = 0
44
private const val MAX = 100
5-
private const val FIZZBUZZ = 15
6-
private const val FIZZ = 3
7-
private const val BUZZ = 5
85

96
object 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

solution/kotlin/day14/src/main/kotlin/games/FizzBuzz.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ import arrow.core.Some
66

77
private const val MIN = 0
88
private const val MAX = 100
9-
private const val FIZZBUZZ = 15
10-
private const val FIZZ = 3
11-
private const val BUZZ = 5
129

1310
object 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

solution/kotlin/day17/src/main/kotlin/games/FizzBuzz.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ import arrow.core.Some
66

77
const val MIN = 1
88
const val MAX = 100
9-
private const val FIZZBUZZ = 15
10-
private const val FIZZ = 3
11-
private const val BUZZ = 5
129

1310
object 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

0 commit comments

Comments
 (0)