-
-
Save abap34/0dbec249e58df8e2ed03efb24d50520e to your computer and use it in GitHub Desktop.
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
S = "\t☆ | |
/\ | |
/★∴ \ | |
(人_人_人) | |
/∴∵★∵★∵ \ | |
(_人_人_人_) | |
/☆∴∵∴∵★ ∴ \ | |
(_人★人☆人_ ) | |
 ̄凵 ̄ " | |
function show_tree() | |
for s in S | |
if s in ('∴', '☆', '∵', '★', '☆') | |
printstyled(s, color=rand(1:255)) | |
elseif s in (' ̄', '凵', ' ̄') | |
printstyled(s, color=:red) | |
else | |
printstyled(s, color=:light_green) | |
end | |
end | |
end | |
function clean(H) | |
buf = IOBuffer() | |
for i in 1:H+1 | |
print(buf, "\x1b[2K") # clear line | |
print(buf, "\x1b[999D\x1b[$(1)A") # rollback | |
end | |
print(buf |> take! |> String) | |
end | |
H = 7 | |
buf = IOBuffer() | |
for i in 1:100 | |
show_tree() | |
sleep(0.5) | |
clean(H) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment