Created
February 12, 2015 17:25
-
-
Save AndrewReitz/f69e7ded14b7ecb28402 to your computer and use it in GitHub Desktop.
Console Warmer
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
var n = 60 | |
var n2 = 20 | |
while (true) { | |
n = n + (if (scala.util.Random.nextBoolean()) 1 else -1) | |
n = n max 0 min 80 | |
n2 = n2 + (if (scala.util.Random.nextBoolean()) 1 else -1) | |
n2 = n2 max 0 min 80 | |
for (i <- 0 until (n min n2)) print(" ") | |
if (n2 < n) print("░") else print("█") | |
for (i <- 0 until (n max n2) - (n min n2)) print(" ") | |
if (n2 > n) print("░") else print("█") | |
print("\n") | |
Thread.sleep(500) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment