Created
October 10, 2017 02:40
-
-
Save Juanfra24/6985af256591a8a13611ac6e5348fb74 to your computer and use it in GitHub Desktop.
Tarea 4 -Clojure- created by Juanfra24 - https://repl.it/MWW6/0
This file contains hidden or 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
(require '[clojure.string :as str]) | |
(use '[clojure.string :only (replace-first)]) | |
(def altura (atom (rand-int 30))) | |
(def cont1 (atom 0)) | |
(def linea (atom " ")) | |
(println @linea) | |
;(swap! linea (partial str/join @linea)) | |
;swap! x (partial + 3)) | |
(while(> @altura @cont1)(do | |
(swap! cont1 inc) | |
(reset! linea (replace-first @linea #" " "#")) | |
(println @linea) | |
; (while(> @altura @cont1)(do | |
)) | |
; printf("Imprimiendo pirámide de altura %i\n", altura); | |
;for(int i=0; i<altura; i++) { | |
; for(int j=0; j<altura-i-1; j++) { | |
; printf(" "); | |
; } | |
; for(int j=0; j<i+1; j++) { | |
; printf("#"); | |
; } | |
; printf("\n"); | |
; } | |
;} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment