-
Notifications
You must be signed in to change notification settings - Fork 0
/
vcs.py
40 lines (31 loc) · 750 Bytes
/
vcs.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
def openW():
return open('/dev/vcs','w')
def getContent():
f = open('/dev/vcs','r')
content = f.read()
f.close()
return content
def write(x,y,string):
content = getContent()
pos = x + y * 100
content = list(content)
content[pos:pos + len(string)] = list(string)
f = openW()
f.write("".join(content))
f.close()
def clear():
f = openW()
f.write(" "*100*30)
f.close()
def clearRect(x,y,width,height):
for i in range(y, y + height):
write(x, i, " " * width)
def drawRect(x,y,width,height,clear = True):
write(x, y, "-" * width)
write(x, y + height - 1, "-" * width)
for i in range(y + 1, y + height - 1):
if(clear):
write(x, i, "|" + " " * (width - 2) + "|")
else:
write(x, i, "|")
write(x + width - 1, i, "|")