Skip to content

Instantly share code, notes, and snippets.

@sebm
Created July 31, 2016 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebm/dd0fafec798e1bdcbb64e00e23ef6a10 to your computer and use it in GitHub Desktop.
Save sebm/dd0fafec798e1bdcbb64e00e23ef6a10 to your computer and use it in GitHub Desktop.
object Sequence {
def main(args: Array[String]): Unit = {
val REFRESH = 100
val ROCKET = "\uD83D\uDE80"
val EARTH = "\uD83C\uDF0E"
val BOOM = "\uD83D\uDD25"
val MAX_TICKS = 20
while (true) {
var ticks = 0
while (ticks < MAX_TICKS) {
Thread.sleep(REFRESH)
println("\033[2J\033[1;1H")
println(s"${" "*ticks}$ROCKET${" "*(MAX_TICKS-ticks)}$EARTH")
ticks += 1
}
println("\033[2J\033[1;1H")
println(s"${" "*ticks}$BOOM")
Thread.sleep(2000)
}
}
}
@sebm
Copy link
Author

sebm commented Jul 31, 2016

animation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment