-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.nim
37 lines (28 loc) · 1.01 KB
/
main.nim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import os, random, strutils, illwill, rainbow
randomize()
const mensaje: string = " __ __ _ \n / /_ ____ ______/ /__(_)___ ____ _ \n / __ \\/ __ `/ ___/ //_/ / __ \\/ __ `/ \n / / / / /_/ / /__/ ,< / / / / / /_/ / _ _ \n/_/ /_/\\__,_/\\___/_/|_/_/_/ /_/\\__, (_|_|_)\n /____/ ".rbGreen1.rfBlack
proc exitProc() {.noconv.} =
illwillDeinit()
showCursor()
quit(0)
proc main() =
illwillInit(fullscreen=true)
setControlCHook(exitProc)
hideCursor()
while true:
var tb = newTerminalBuffer(terminalWidth(), terminalHeight())
var key = getKey()
case key
of Key.Escape, Key.Q: exitProc()
else: discard
echo mensaje
var height = tb.height-7
for x in 1..height:
var hehe = intToStr(rand(9))
var width = tb.width-2
for i in 0..width:
hehe &= intToStr(rand(9))
echo hehe
sleep(50)
discard execShellCmd("cls")
main()