-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathmultiwall_kiu-arrows.py
executable file
·129 lines (101 loc) · 2.14 KB
/
multiwall_kiu-arrows.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import acabsl
import random
import time
cs = [
[255,255,000,000,000,255],
[000,255,255,255,000,000],
[000,000,000,255,255,255],
]
tfade = 0.3
tick = 0.1
wall = 0
def drawa(c,r,c1):
acabsl.send(c,r,cs[0][c1],cs[1][c1],cs[2][c1],tfade,wall)
for x in range(1,c):
acabsl.send(x,r,cs[0][c1],cs[1][c1],cs[2][c1],tfade,wall)
for y in range(0,r):
acabsl.send(c,y,cs[0][c1],cs[1][c1],cs[2][c1],tfade,wall)
acabsl.update()
def drawb(c,r,c1):
acabsl.send(c,r,cs[0][c1],cs[1][c1],cs[2][c1],tfade,wall)
for x in range(c,7):
acabsl.send(x,r,cs[0][c1],cs[1][c1],cs[2][c1],tfade,wall)
for y in range(0,r):
acabsl.send(c,y,cs[0][c1],cs[1][c1],cs[2][c1],tfade,wall)
acabsl.update()
def drawc(c,r,c1):
acabsl.send(c,r,cs[0][c1],cs[1][c1],cs[2][c1],tfade,wall)
for x in range(c,7):
acabsl.send(x,r,cs[0][c1],cs[1][c1],cs[2][c1],tfade,wall)
for y in range(r,6):
acabsl.send(c,y,cs[0][c1],cs[1][c1],cs[2][c1],tfade,wall)
acabsl.update()
def drawd(c,r,c1):
acabsl.send(c,r,cs[0][c1],cs[1][c1],cs[2][c1],tfade,wall)
for x in range(1,c):
acabsl.send(x,r,cs[0][c1],cs[1][c1],cs[2][c1],tfade,wall)
for y in range(r,6):
acabsl.send(c,y,cs[0][c1],cs[1][c1],cs[2][c1],tfade,wall)
acabsl.update()
acabsl.update()
for c in range(0,8):
for r in range(0,6):
acabsl.send(c,r,0,0,0, 0.5)
acabsl.update()
time.sleep(0.5)
x = 1
y = 0
lastc = 0
c = 0
mode = 0
lastm = 0
while 1:
while c == lastc:
c = random.randint(0,5)
lastc = c
if mode != lastm:
time.sleep(tick * 6)
lastm = mode
if mode == 0:
drawa(x,y,c)
wall = 1 - wall
drawa(x,y,c)
x = x + 1
y = y + 1
if x > 6:
x = 6
y = 0
mode = 1
if mode == 1:
drawb(x,y,c)
wall = 1 - wall
drawb(x,y,c)
x = x - 1
y = y + 1
if x < 1:
x = 6
y = 5
mode = 2
if mode == 2:
drawc(x,y,c)
wall = 1 - wall
drawc(x,y,c)
x = x - 1
y = y - 1
if x < 1:
x = 1
y = 5
mode = 3
if mode == 3:
drawd(x,y,c)
wall = 1 - wall
drawd(x,y,c)
x = x + 1
y = y - 1
if x > 6:
x = 1
y = 0
mode = 0
time.sleep(tick)