forked from mouredev/retos-programacion-2023
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mouredev#6695 from php08080/php08080
Reto #0 - Clojure
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/clojure/php08080.clj
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,21 @@ | ||
|
||
; 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". | ||
; | ||
|
||
(defn imprimir [lista] | ||
(doseq [n lista] | ||
(cond | ||
(zero? (mod n 15)) (println n "FizzBuzz") | ||
(zero? (mod n 3)) (println n "Fizz") | ||
(zero? (mod n 5)) (println n "Buzz") | ||
:else (println n)))) | ||
|
||
(imprimir (range 1 101)) | ||
|
||
;demaciado imperativo a mi gusto :c | ||
|