From fc9b3a073a94f1ad96cfb73eac1724c7975be5c5 Mon Sep 17 00:00:00 2001 From: Joaquin Rivero Date: Mon, 2 Jan 2023 20:56:40 +0100 Subject: [PATCH 1/3] Little Fix --- .../dart/bushi.dart" | 21 ++++++++++++------- .../kotlin/bushi.kt" | 21 +++++++++++-------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git "a/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/dart/bushi.dart" "b/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/dart/bushi.dart" index ebf54765c1..ada19ac8fc 100644 --- "a/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/dart/bushi.dart" +++ "b/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/dart/bushi.dart" @@ -1,14 +1,19 @@ void main() { - for (var i = 1; i <= 100; i++) { - var result = "$i. "; + _fizzbuzz(); +} - if (i % 3 == 0) { - result += "fizz"; +void _fizzbuzz() { + for (var i = 1; i <= 100; i++) { + if (i % 3 == 0 && i % 5 == 0) { + print("fizzbuzz\n"); } - if (i % 5 == 0) { - result += "buzz"; + else if (i % 3 == 0) { + print("fizz\n"); + } + else if (i % 5 == 0) { + print("buzz\n"); + } else { + print("$i\n"); } - - print("$result\n"); } } \ No newline at end of file diff --git "a/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/kotlin/bushi.kt" "b/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/kotlin/bushi.kt" index 7bc0556d0b..f1005c27d1 100644 --- "a/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/kotlin/bushi.kt" +++ "b/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/kotlin/bushi.kt" @@ -1,14 +1,17 @@ fun main() { - for (i in 1..100) { - var result = "$i. " + fizzbuzz() +} - if (i % 3 == 0) { - result += "fizz" - } - if (i % 5 == 0) { - result += "buzz" +private fun fizzbuzz() { + for (i in 1..100) { + if (i % 3 == 0 && i % 5 == 0) { + println("fizzbuzz") + } else if (i % 3 == 0) { + println("fizz") + } else if (i % 5 == 0) { + println("buzz") + } else { + println(i) } - - println(result) } } \ No newline at end of file From a706847c9519a957e3a8a99d6f1933a32b2b0d84 Mon Sep 17 00:00:00 2001 From: Joaquin Rivero Date: Mon, 2 Jan 2023 21:12:38 +0100 Subject: [PATCH 2/3] Change files name --- .../dart/joaquin-rivero.dart" | 19 +++++++++++++++++++ .../kotlin/joaquin-rivero.kt" | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 "Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/dart/joaquin-rivero.dart" create mode 100644 "Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/kotlin/joaquin-rivero.kt" diff --git "a/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/dart/joaquin-rivero.dart" "b/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/dart/joaquin-rivero.dart" new file mode 100644 index 0000000000..ada19ac8fc --- /dev/null +++ "b/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/dart/joaquin-rivero.dart" @@ -0,0 +1,19 @@ +void main() { + _fizzbuzz(); +} + +void _fizzbuzz() { + for (var i = 1; i <= 100; i++) { + if (i % 3 == 0 && i % 5 == 0) { + print("fizzbuzz\n"); + } + else if (i % 3 == 0) { + print("fizz\n"); + } + else if (i % 5 == 0) { + print("buzz\n"); + } else { + print("$i\n"); + } + } +} \ No newline at end of file diff --git "a/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/kotlin/joaquin-rivero.kt" "b/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/kotlin/joaquin-rivero.kt" new file mode 100644 index 0000000000..f1005c27d1 --- /dev/null +++ "b/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/kotlin/joaquin-rivero.kt" @@ -0,0 +1,17 @@ +fun main() { + fizzbuzz() +} + +private fun fizzbuzz() { + for (i in 1..100) { + if (i % 3 == 0 && i % 5 == 0) { + println("fizzbuzz") + } else if (i % 3 == 0) { + println("fizz") + } else if (i % 5 == 0) { + println("buzz") + } else { + println(i) + } + } +} \ No newline at end of file From ffda7ef01b505944f0f7ff3ed336f7da3aa496fa Mon Sep 17 00:00:00 2001 From: Joaquin Rivero Date: Mon, 2 Jan 2023 21:13:39 +0100 Subject: [PATCH 3/3] Change files name --- .../dart/bushi.dart" | 19 ------------------- .../kotlin/bushi.kt" | 17 ----------------- 2 files changed, 36 deletions(-) delete mode 100644 "Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/dart/bushi.dart" delete mode 100644 "Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/kotlin/bushi.kt" diff --git "a/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/dart/bushi.dart" "b/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/dart/bushi.dart" deleted file mode 100644 index ada19ac8fc..0000000000 --- "a/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/dart/bushi.dart" +++ /dev/null @@ -1,19 +0,0 @@ -void main() { - _fizzbuzz(); -} - -void _fizzbuzz() { - for (var i = 1; i <= 100; i++) { - if (i % 3 == 0 && i % 5 == 0) { - print("fizzbuzz\n"); - } - else if (i % 3 == 0) { - print("fizz\n"); - } - else if (i % 5 == 0) { - print("buzz\n"); - } else { - print("$i\n"); - } - } -} \ No newline at end of file diff --git "a/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/kotlin/bushi.kt" "b/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/kotlin/bushi.kt" deleted file mode 100644 index f1005c27d1..0000000000 --- "a/Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [F\303\241cil]/kotlin/bushi.kt" +++ /dev/null @@ -1,17 +0,0 @@ -fun main() { - fizzbuzz() -} - -private fun fizzbuzz() { - for (i in 1..100) { - if (i % 3 == 0 && i % 5 == 0) { - println("fizzbuzz") - } else if (i % 3 == 0) { - println("fizz") - } else if (i % 5 == 0) { - println("buzz") - } else { - println(i) - } - } -} \ No newline at end of file