Skip to content

Commit 4068fb6

Browse files
authored
Merge pull request #135 from PdxCodeGuild/jonpan-mini-capstone
Jonpan python mini capstone
2 parents 3bd16d1 + 1b83fd0 commit 4068fb6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

code/jonpan/capstone.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# mini-python capstone
2+
3+
from random import randint
4+
from asciimatics.screen import Screen
5+
6+
def demo(screen):
7+
while True:
8+
screen.print_at(text,
9+
randint(0, screen.width), randint(0, screen.height),
10+
colour=randint(0, screen.colours - 1),
11+
bg=randint(0, screen.colours - 1))
12+
ev = screen.get_key()
13+
if ev in (ord('Q'), ord('q')):
14+
return
15+
screen.refresh()
16+
17+
text = input("Enter a string: ")
18+
19+
Screen.wrapper(demo)

0 commit comments

Comments
 (0)