Created
August 20, 2015 15:16
-
-
Save vgmoose/b7b73caf13e75f014b4c to your computer and use it in GitHub Desktop.
outputs an exclamation point in the center of the terminal
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
# clear the screen | |
IO.write("\e[3;J\e[H\e[2J") | |
# get the height and width | |
h = elem(Integer.parse(elem(System.cmd("tput", ["lines"]),0)),0) | |
w = elem(Integer.parse(elem(System.cmd("tput", ["cols"]),0)),0) | |
# get the center of the screen | |
xmid = round(w/2) | |
ymid = round(h/2) | |
# display ! in middle | |
IO.write("\e[#{ymid};#{xmid}H!") | |
# move cursor to bottom right | |
IO.write("\e[#{h};#{w}H") | |
IO.gets "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment