-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample01.py
50 lines (40 loc) · 952 Bytes
/
sample01.py
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
38
39
40
41
42
43
44
45
46
47
48
49
50
# -*- coding: shift_jis -*-
# xbasip sample programs
# nozwas <https://github.com/nozwas>
r"""sample01.py
consoleモジュールの使用例
"""
from xbasip.console import *
from random import randrange
width(64)
console(0, 31, 0)
color(2)
cursor_off()
for i in range(100):
print("personal workstation X68000 ", end = "")
console(5, 21, 0)
cls()
for i in range(200):
color(1)
print("personal workstation X68000 ", end = "")
color(3)
print("")
print("-" * 50)
print("何かキーを押してください")
print("-" * 50, end="")
keyflush() # キーバッファをクリア
k = inkey() # inkey()は入力されるまで待ちます
width(96)
console(0, 31, 0)
cls()
beep()
print("もう一度何かキーを押してください")
print("-" * 50, end="")
keyflush()
while inkey0() == 0: #inkey0()は入力を待ちません
color(randrange(16))
locate(randrange(96), randrange(28) + 2)
print("X68K", end="")
color(3)
cls()
end()