-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into main
- Loading branch information
Showing
6 changed files
with
82 additions
and
28 deletions.
There are no files selected for viewing
14 changes: 0 additions & 14 deletions
14
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/dart/bushi.dart
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/dart/joaquin-rivero.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/javascript/jesusSan1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Escribe un programa que muestre por consola (con un print) los | ||
* números de 1 a 100 (ambos incluidos y con un salto de línea entre | ||
* cada impresión), sustituyendo los siguientes: | ||
* - Múltiplos de 3 por la palabra "fizz". | ||
* - Múltiplos de 5 por la palabra "buzz". | ||
* - Múltiplos de 3 y de 5 a la vez por la palabra "fizzbuzz". | ||
*/ | ||
|
||
for (let i = 1; i <= 100; i++) { | ||
if (i % 15 == 0) console.log("FizzBuzz"); | ||
else if (i % 3 == 0) console.log("Fizz"); | ||
else if (i % 5 == 0) console.log("Buzz"); | ||
else console.log(i); | ||
} |
14 changes: 0 additions & 14 deletions
14
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/kotlin/bushi.kt
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/kotlin/joaquin-rivero.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/php/kevocde.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* Challenge #0 - The famous Fizz Buzz | ||
*/ | ||
const LIMITS = [1, 100]; | ||
|
||
/** | ||
* Prints the fizz buzz sequence | ||
* | ||
* @param int $from | ||
* @param int $until | ||
* @return void | ||
*/ | ||
function printFizzBuzzSequence($from, $until) { | ||
for ($i = $from; $i <= $until; $i ++) { | ||
// First determinates if the number is multiple of | ||
$isThreeMultiple = ($i % 3) === 0; | ||
$isFiveMultiple = ($i % 5) === 0; | ||
|
||
// Second generates a string and prints | ||
echo implode([ | ||
$isThreeMultiple ? 'fizz' : '', | ||
$isFiveMultiple ? 'buzz' : '', | ||
($isThreeMultiple || $isFiveMultiple) ? '' : $i | ||
]); | ||
|
||
echo "\n"; | ||
} | ||
} | ||
|
||
printFizzBuzzSequence(...LIMITS); |