Text Size
Text Size
Exit Full Screen
Python Mini
Show
Source Code
View Source Code in Full Screen
Open in New Tab
from processing import * from random import randint gamestate = 'level' levels = [ [ ['127',' ','-','-','-'], ['-',' ','-','-','-'], ['-','-','-',' ','O2.127'], ], [ ['120','-',' ','-','-','-'], ['-','-',' ','-','-','-'], ['-','-','&17.4','-','-','O8.185'], ['-','-',' ','-','-','-'], ['250','-',' ','-','-','-'] ], [ ['0','-','-','-'], [' ',' ','-',' '], ['-','&83.5','-',' '], [' ','-','-','100'], ['-','-','-','-'], ['O2.50',' ',' ',' '], ], [ ['120','-',' ','&46.5','-','?'], ['-','-',' ','-','-','-'], ['-','-','X17.4','-','-','O8.185'], ['-','-',' ','-','-','-'], ['250','-',' ','-','-','-'] ], [ [' ',' ',' ','-','-','O4.30','-'], [' ',' ',' ','-','-','-','-'], [' ',' ','-','-',' ','-','-'], ['60','-','&84.3','-',' ','0',' '] ], [ ['-','-',' ',' ',' ',' ',' '], ['0','-',' ',' ','-','-','-'], ['-','&26.5','-','-','-','-','O1.15'], ['-','-','-','-','-','-','-'], ['60','-',' ',' ','-','&18.2','-'] ], [ ['-','-','-',' ',' ',' ',' ',' '], ['120','-','-',' ',' ',' ','-','O8.210'], ['-','-','&27.5','-','-','-','-','-'], ['-','-',' ','-','-','-','-',' '], ['240','-',' ',' ',' ','-','&18.2',' '] ], [ ['-','-','-','-',' ',' '], ['-','&17.4','-','-','O6.60','O6.0'], ['-',' ',' ','-','-','-'], [' ',' ',' ','-','-','-'], ['60','-',' ','-',' ',' '], ['0','-','-','-',' ',' '] ], [ ['-','-','-','O4.120','-'], ['-',' ','X15.26',' ','-'], ['-',' ','-','-','-'], ['-','O14.120','-',' ','120'] ], [ [' ',' ','-','-','-','250'], [' ','-','-','-','-','-'], [' ','-','-','-',' ',' '], ['O6.185',' ','-','X37.1','-','-'], ['-',' ','-','-','&46.7','-'], [' ','-','-','-','-','-'], ['120',' ',' ',' ',' ',' '], ], [ ['-','-',' ','-','-'], ['0','-','O84.60','-','120'], ['-','-',' ','-','-'], ], [ ['-','-','?','-','-'], ['-','-',' ','-','-'], [' ','-','O83.60',' ',' '], ['0','-','O85.60',' ',' '], [' ','-',' ','-','-'], ['120','-','-','-','-'] ], [ ['-','-','-','-','-','-'], [' ',' ',' ','&75.2',' ','O26.150'], ['-',' ','-',' ','-','-'], ['240','&17.4','-','-','-','-'], ['-',' ','-',' ','-','-'], ['-','-','120',' ','-','?'] ], [ ['-','-',' ','-','-','O6.8'], ['0','-',' ','-','-','-'], ['-','-','&17.3','-','-','-'], ['128','-','-','-','-','&28.1'] ], [ ['O6.15','-',' ',' ','-','-',' ',' ',' '], ['-','-','-','-','-','-','-','-','120'], ['-','-',' ',' ','&72.4','-','-',' ','-'], ['-','-',' ','-','-','-','&84.6','-','-'], ['-','-','?',' ',' ','-','-','-','-'], ['-','-','-','-','0',' ','-',' ',' '], ], [ ['0','-','-','-'], [' ',' ','-',' '], ['-','&83.5','-',' '], [' ','-','-','100'], ['-','-','-','-'], ['O2.50',' ',' ',' '], ], [ [' ',' ',' ','-','-','O4.30','-'], [' ',' ',' ','-','-','-','-'], [' ',' ','-','-',' ','-','-'], ['60','-','&84.3','-',' ','0',' '] ], [ [' ',' ','O6.20','60','O6.45',' ',' '], [' ',' ','-','-','?',' ',' '], ['0','-','-','-','-','-','O8.0'], ['-','-','-','?','-','-','-'], ['120','-','-','-','-','-','O8.120'], [' ',' ','-','-','-',' ',' '], [' ',' ','O2.60','20','45',' ',' '] ], [ ['0',' ','0',' ','90',' ','7',' ','-','-','-'], ['-',' ','-',' ','-',' ','-',' ','-','-','-'], ['-','&17.4','-','&17.4','-','&17.4','-','&17.4','-','-','O8.60'], ['-',' ','-',' ','-',' ','-',' ','-','-','-'], ['150',' ','44',' ','220',' ','23',' ','-','-','-'] ], [ ['100',' ',' ','?','-','-','O8.60',' ',' ',' '], ['&2.5',' ',' ','&75.2',' ',' ',' ',' ',' ',' '], ['-','-','-','-','-','-','-',' ','140',' '], ['-','&2.4','-',' ','-','-',' ','&13.6',' ',' '], ['-',' ','-',' ',' ','-',' ','-',' ','-'], ['-',' ','X75.2',' ',' ','X75.2',' ',' ','&13.7','-'], ['0','-','-','-','-','-','-','-',' ','-'], [' ','-','-','-','-','-','-','-','&85.3',' '], [' ',' ',' ',' ',' ',' ',' ',' ',' ','140'], ] ] board = [] ''' board = [ ['-','-','-','-'], ['-','-','-','-'], ['-','-','-','-'], ['-','-','-','-'] ]''' dirs = { '1':[-1,-1], '2':[0,-1], '3':[1,-1], '4':[1,0], '5':[1,1], '6':[0,1], '7':[-1,1], '8':[-1,0], '9':[0,0], '0':[0,0], } class Tile: instances = [] def __init__(self,listy,listx,tags=[None],has=[None]): self.listy = listy self.listx = listx self.offx = 0.0 self.offy = float(5**(listy+listx)) self.tx = 0.0 self.ty = 0.0 self.has = has self.tags = tags Tile.instances.append(self) class Wire: instances = [] def __init__(self,inside): self.inside = [inside] self.connections = [] self.power = [] Wire.instances.append(self) class Gate: instances = [] def __init__(self,am,operate="or",inputs=[],outputs=[]): self.am = am self.operate = operate self.inputs = inputs self.outputs = outputs self.inval = [] self.outval = None self.timeon = 0 Gate.instances.append(self) class Button: instances = [] def __init__(self,x,y,sx,sy,setstate,txt='',broken=False,active=True,cleared=False): self.x = x self.y = y self.sx = sx self.sy = sy self.setstate = setstate self.offy = 0.0 self.ty = 0.0 self.txt = txt self.active = active self.broken = broken self.cleared = cleared Button.instances.append(self) def clicked(self): if mb == True: if self.active == True: if touching(mouse.x,mouse.y,self.x,self.y-20,0,0,self.sx,self.sy): setState(self.setstate) if self.broken == True: self.active = False def make(self): fill(0xff0c2B33) rect(self.x,self.y,self.sx,self.sy) hue = 26 sat = 255 bri = 238 if self.setstate[8:] in can1: hue = 0 sat = 150 bri = 255 if self.active == True: if touching(mouse.x,mouse.y,self.x,self.y-20,0,0,self.sx,self.sy): sat -= 95 bri += 17 self.ty = -5.0 else: self.ty = 0.0 if self.active == False: bri = 120 self.ty = 7.0 if self.cleared == True: hue = 127 bri += 15 fill(hue,sat,bri) self.offy = exphone(self.offy,self.ty,5,1) rect(self.x,self.y-20+self.offy,self.sx,self.sy) textSize(30) fill(0xff0c2B33) text(self.txt,self.x+self.sx/2,self.y+self.offy) def setState(a): global gamestate gamestate = a def outline(texta,px,py,weight=2,outcolor=0,fillcolor=255): fill(outcolor); for x in range(weight): for y in range(weight): text(texta, px-x+1,py-y+1) fill(fillcolor); text(texta, px,py); def setup(): global keys, length, objs, active, mb, timer, levamt, precise, deltime, hover, prevhover global back, back2, levbutton, can1, redbg redbg = 0 textAlign(CENTER,CENTER) back = Button(200,265,100,50,'level','Back') back2 = Button(459,20,40,40,'level','<') timer = 0 deltime = 0 hover = None prevhover = None can1 = ['15','16','17','18','19'] te = 50#90 levamt = 20 precise = False levbutton = { } for j in range(4): for i in range(5): if j*5+i < len(levels): okay = True else: okay = False#90 levbutton[str(j*5+i)] = Button(20+i*100,te+j*100,60,60,'loadload'+str(j*5+i),str(j*5+i+1),True,okay) colorMode(HSB) length = 0 keys = [] mb = False objs = 0 active = 0 size(500,560) def loadLevel(num): global board, objs objs = 0 board = levels[num] for i in range(len(board)): #row for j in range(len(board[i])): #column if board[i][j] == '-': board[i][j] = Tile(i,j) elif board[i][j].isdigit(): board[i][j] = Tile(i,j,[int(board[i][j])]) elif board[i][j][0] == '?': board[i][j] = Tile(i,j,['copy']) elif board[i][j][0] in ['&','+','O','X']: full = [] full2 = [] k = board[i][j][1:] k = k.split('.') for ok in k[0]: full.append(dirs[ok]) for ok in k[1]: full2.append(dirs[ok]) if board[i][j][0] == '&': board[i][j] = Tile(i,j,[None],['gate']) Gate(board[i][j],'and',full,full2) elif board[i][j][0] == '+': board[i][j] = Tile(i,j,[None],['gate']) Gate(board[i][j],'or',full,full2) elif board[i][j][0] == 'X': board[i][j] = Tile(i,j,[None],['gate']) Gate(board[i][j],'xor',full,full2) elif board[i][j][0] == 'O': board[i][j] = Tile(i,j,[None],['gate']) Gate(board[i][j],int(k[1]),full,[]) objs += 1 def keyPressed(): global keys if keyboard.keyCode not in keys: keys.append(keyboard.keyCode) #print keys def keyReleased(): global keys if keyboard.keyCode in keys: keys.remove(keyboard.keyCode) def mousePressed(): global mb mb = True def mouseReleased(): global mb mb = False def getGridPos(x,y): if len(board) < len(board[0]): k = [50+(x*length)] k = k + [50+(y*length)+((len(board[0])-len(board))*length/2)] else: k = [50+(y*length)] k = [50+(x*length)+((len(board)-len(board[0]))*length/2)] + k return k def touching(x1,y1,x2,y2,sx1,sy1,sx2,sy2): if x1+sx1 >= x2 and x1 <= x2+sx2 and y1+sy1 >= y2 and y1 <= y2+sy2: return True else: return False def exphone(var,target,mult,snap): if var < snap+target and var > target-snap and var != target: var = target else: var += (target-var)/mult return var def cylinder(x,y,sx,sy,d,color2): ellipse(x,y+sy,sx,d) beginShape() vertex(x-sx/2,y+sy) vertex(x-sx/2,y) vertex(x+sx/2,y) vertex(x+sx/2,y+sy) endShape() fill(color2) ellipse(x,y,sx,d) def drawBoard(): global length, keys, gamestate, active, precise, redbg active = 0 if len(board) > len(board[0]): length = 400/len(board) else: length = 400/len(board[0]) origin = getGridPos(0,0) botcorner = getGridPos(len(board[0])-1,len(board)-1) fill(0xff041B23) rect(origin[0]-25,origin[1]-25,botcorner[0]-origin[0]+length+50,botcorner[1]-origin[1]+length+50) fill(0xff0c2B33) rect(origin[0],origin[1],botcorner[0]-origin[0],botcorner[1]-origin[1]) for i in range(len(board)): #row for j in range(len(board[i])): #column pos = getGridPos(j,i) k = board[i][j] fill(0xff0c2B33) rect(pos[0],pos[1],length,length) if board[i][j] != ' ': fill(0xff0E3B43) if k.offy <= length/2: rect(pos[0],pos[1]+k.offy,length,length-k.offy) if precise != False: nearit = False if k.listx+1 >= precise.inside[0].listx and k.listx-1 <= precise.inside[0].listx and k.listy+1 >= precise.inside[0].listy and k.listy-1 <= precise.inside[0].listy: nearit = True hue = 26 sat = 255 bri = 238 if k.tags[0] in range(256): hue = k.tags[0] if touching(mouse.x,mouse.y,pos[0],pos[1]-length*.5,0,0,length-1,length-1) and not k.has[0]: if precise == False: sat = 160 bri = 255 elif nearit: sat = 160 bri = 255 else: sat = 190 bri = 255 if gamestate != 'cleared': k.ty = length*-.1 if precise != False: if nearit: k.ty = length*-.15 else: k.ty = 0 else: if gamestate != 'cleared': k.ty = 0.0 if precise != False: if nearit: k.ty = length*-.05 else: k.ty = length*.1 if k.tags[0] in range(256): bri = 210 sat = 255 if k.tags[0] == 'copy': sat = 0 bri = 200 if precise != False: if not nearit: bri -= 20 fill(hue,sat,bri) if k.offy <= length/2: rect(pos[0],pos[1]-length*.5+k.offy,length,length) if k.tags[0] == 'copy': rect(pos[0]+length*.2,pos[1]-length*.3+k.offy,length*.6,length*.6) if k.has[0] == "wire": fill(0xff3c3d4d) cylinder(pos[0]+length/2,pos[1]+k.offy-length*.1,length*.25,length*.1,length*.25,0xff55566b) elif k.has[0] == "gate": fill(0xff3c3d4d) rect(pos[0]+length*.1,pos[1]+k.offy-length*.4,length*.8,length*.8) fill(0xff55566b) rect(pos[0]+length*.1,pos[1]+k.offy-length*.8,length*.8,length*.8) k.offy = exphone(k.offy,k.ty,length*.1,length*.01) for j in Wire.instances: j.power = [] for i in j.inside: if i.tags[0] in range(256): j.power.append(i.tags[0]) stroke(0xff3c3d4d) strokeWeight(length*.1) if not j.power: for i in Gate.instances: for lob in i.outputs: for ok in j.inside: if ok.listy == i.am.listy+lob[1] and ok.listx == i.am.listx+lob[0] and i.outval != None: j.power = [i.outval] if j.power: #j.power = sum(j.power)/(len(j.power)) #j.power %= 256 j.power = j.power[randint(0,len(j.power)-1)] stroke(j.power,230,255) for i in j.connections: pos1 = getGridPos(i[0].listx,i[0].listy) pos2 = getGridPos(i[1].listx,i[1].listy) if i[0].offy <= length/2 or i[1].offy <= length/2: line(pos1[0]+length/2,pos1[1]-length*.1+i[0].offy,pos2[0]+length/2,pos2[1]-length*.1+i[1].offy) strokeWeight(1) stroke(0) for i in j.inside: if i.tags[0] == 'copy' and j.power != []: i.tags[0] = j.power for j in Gate.instances: before = j.outval j.inval = [] j.outval = None stroke(0xff55566b) strokeWeight(length*.1) pos = getGridPos(j.am.listx,j.am.listy) for i in j.inputs: fill(0) did = 0 for wire in Wire.instances: for ok in wire.inside: if ok.listy == j.am.listy+i[1] and ok.listx == j.am.listx+i[0] and wire.power != []: fill(wire.power,230,255) j.inval.append(wire.power) did = 1 if not did: j.inval.append(None) if j.am.offy <= length/2: line(pos[0]+length/2,pos[1]+j.am.offy-length*.3,pos[0]+length/2+length*i[0],pos[1]+j.am.offy-length*.3+length*i[1]) ellipse(pos[0]+length/2+length*i[0],pos[1]+j.am.offy-length*.3+length*i[1],length*.3,length*.3) stroke(0xff6d9394) fill(0) did = 0 if j.operate == 'or': for i in j.inval: if i != None: did = 1 elif j.operate == 'and': if None not in j.inval: did = 1 elif j.operate == 'xor': for i in j.inval: if i != None and did == 0: did = 1 elif i != None and did == 1: did = -1 else: if None not in j.inval: did = 1 if did == 1: k = 0 okay = 0 for i in j.inval: if i != None: k += i okay += 1 j.outval = k/okay fill(j.outval,230,255) else: j.timeon = 0 if j.am.offy <= length/2: for i in j.outputs: line(pos[0]+length/2,pos[1]+j.am.offy-length*.3,pos[0]+length/2+length*i[0],pos[1]+j.am.offy-length*.3+length*i[1]) ellipse(pos[0]+length/2+length*i[0],pos[1]+j.am.offy-length*.3+length*i[1],length*.3,length*.3) fill(0xff55566b) strokeWeight(1) stroke(0) rect(pos[0]+length*.1,pos[1]+j.am.offy-length*.8,length*.8,length*.8) if type(j.operate) == int: if j.timeon > 0: fill(j.outval,255,255) rect(pos[0]+length*.1,pos[1]+j.am.offy-length*.8,length*.8/(21-j.timeon),length*.8) fill(0xff55566b) rect(pos[0]+length*.2,pos[1]+j.am.offy-length*.7,length*.6,length*.6) #fill(0xff00fffb) textSize(length*.7) if j.operate == 'and': outline('&',pos[0]+length*.5,pos[1]+j.am.offy-length*.4) elif j.operate == 'or': outline('+',pos[0]+length*.5,pos[1]+j.am.offy-length*.4) elif j.operate == 'xor': outline('+',pos[0]+length*.5,pos[1]+j.am.offy-length*.4) outline('X',pos[0]+length*.5,pos[1]+j.am.offy-length*.4) else: fill(j.operate,255,255) text('O',pos[0]+length*.5,pos[1]+j.am.offy-length*.4) if did == 1: if j.timeon < 20: j.timeon += 1 if j.outval != before: j.timeon = 0 if j.outval == j.operate: if j.timeon >= 20: active += 1 strokeWeight(1) stroke(0) fill(0xff041B23) rect(-10,500,520,110) fill(0xff0c2B33) for i in range(10): rect(5+50*i,510,40,40) fill(0xff3c3d4d) cylinder(25,525,30,10,10,0xff55566b) strokeWeight(5) if gamestate[4:] in can1: stroke(0xffff0000) line(15,520,35,540) line(35,520,15,540) fill(0,255,255) noStroke() rect(5,510,40,redbg) stroke(0xff00fffb) line(65,520,85,540) line(85,520,65,540) line(75,520,75,540) line(65,530,85,530) strokeWeight(1) stroke(0) fill(0xff3c3d4d) cylinder(75,527,15,5,10,0xff55566b) stroke(0xffff0000) strokeWeight(5) line(465,520,485,540) line(485,520,465,540) noStroke() fill(0xffff00ff) rect(405,510,deltime,40) stroke(0xffff00ff)#cannot delete with 0 line(415,520,435,540)#new delete function line(435,520,415,540) strokeWeight(1) stroke(0) def draw(): global length, keys, gamestate, back, back2, timer, board, precise, deltime, hover, prevhover, redbg redbg = exphone(redbg,0,10,1) background(0xffEACBD2) if gamestate == 'level': for i in range(levamt): k = levbutton[str(i)] k.make() if timer < 0: k.clicked() outline("Press 1 to lay wire",250,450,4) outline("Press 0 to remove wire",250,500,4) timer -= 1 Wire.instances = [] Gate.instances = [] Tile.instances = [] board = [] elif gamestate == 'cleared': drawBoard() textSize(70) fill(50,255,255) text('Cleared',250,200) back.make() back.clicked() elif gamestate[:4] == 'load': if gamestate[4:8] == 'load': loadLevel(int(gamestate[8:])) gamestate = 'loadwait' + gamestate[8:] elif gamestate[4:8] == 'wait': gamestate = 'play' + gamestate[8:] elif gamestate[:4] == 'play': mousegrid = [] prevhover = hover for i in range(len(board)): #row for j in range(len(board[i])): #column pos = getGridPos(j,i) if touching(mouse.x,mouse.y,pos[0],pos[1]-length*.5,0,0,length-1,length-1) and board[i][j] != ' ': mousegrid = [j,i] hover = board[i][j] '''if 32 in keys: print for j in Wire.instances: for i in j.connections: print [i[0].listx,i[0].listy],[i[1].listx,i[1].listy]''' if 50 in keys and precise == False: #pressed key "2"? if mousegrid and not hover.has[0]: hover.has = ["wire"] hover.offy = length*.4 hover.ty = 0 did = 0 for j in reversed(Wire.instances): for i in reversed(j.inside): if i.listx+1 >= hover.listx and i.listx-1 <= hover.listx and i.listy+1 >= hover.listy and i.listy-1 <= hover.listy: j.inside.append(hover) j.connections.append([i,hover]) did = 1 break if did: break if not did: Wire(hover) if 49 in keys:#pressed key "1"? if gamestate[4:] not in can1: keys.remove(49) if mousegrid: if precise == False: if mousegrid: if hover.has == [None]: hover.has = ["wire"] hover.offy = length*.4 hover.ty = 0 precise = Wire(hover) elif hover.has == ['wire']: for i in Wire.instances: for j in i.inside: if j == hover: precise = i i.inside.insert(0,i.inside.pop(i.inside.index(j))) break else: if hover.listx+1 >= precise.inside[0].listx and hover.listx-1 <= precise.inside[0].listx and hover.listy+1 >= precise.inside[0].listy and hover.listy-1 <= precise.inside[0].listy: if hover.listx != precise.inside[0].listx or hover.listy != precise.inside[0].listy: if hover.has == [None]: hover.has = ["wire"] hover.offy = length*.4 hover.ty = 0 precise.connections.append([precise.inside[0],hover]) precise.inside.insert(0,hover) elif hover.has == ['wire']: temp1 = precise.inside temp2 = precise.connections temp3 = False for i in Wire.instances: for j in i.inside: if hover == j:#hover.listx == j.listx and hover.listy == j.listy: if precise == i: temp3 = True '''if [precise.inside[0],hover] not in i.connections and [hover,precise.inside[0]] not in i.connections: temp2.append([precise.inside[0],hover])''' else: temp2.append([precise.inside[0],hover]) i.connections.extend(temp2) i.inside.extend(temp1) break if not temp3: Wire.instances.remove(precise) precise = False else: precise = False else: precise = False else: precise = False keys.append(49) else: precise = False else: redbg = 40 ''' if 51 in keys:# if pressed 3 if mousegrid and not hover.has[0]: hover.has = ['gate'] hover.offy = length*.4 hover.ty = 0 did = 0 Gate(hover,"or",[[0,1],[1,0]],[[-1,-1]]) if 51 in keys:# if pressed 3 if mousegrid and not hover.has[0]: hover.has = ['gate'] hover.offy = length*.4 hover.ty = 0 did = 0 Gate(hover,"and",[[-1,0],[1,0]],[[1,-1]]) ''' if 48 in keys: if precise == False: if mousegrid and hover.has[0]: for j in Wire.instances: amt = 0 for i in j.connections: if i[0] == hover: amt += 1 if i[1] == hover: amt += 1 if amt == 1 or len(j.inside) == 1: for i in j.connections: if i[0] == hover: j.connections.remove(i) if i[1] == hover: j.connections.remove(i) if hover in j.inside: hover.has = [None] j.inside.remove(hover) else: precise = False #fil if 57 in keys: if precise == False: if prevhover != hover: deltime = 0 if mousegrid and hover.has[0]: for j in Wire.instances: if hover in j.inside: deltime += 1 for oke in j.inside: oke.offy = randint(deltime*-1,deltime) break if deltime >= 40: deltime = 0 for j in Wire.instances: if hover in j.inside: Wire.instances.remove(j) for kl in j.inside: kl.has = [None] break else: precise = False else: deltime = 0 drawBoard() if active == objs: for i in Button.instances: if i.setstate == 'loadload' + gamestate[4:]: i.cleared = True break gamestate = "cleared" precise = False for i in Tile.instances: i.ty = length*.6 timer = 60 back2.make() back2.clicked() if 32 in keys: textSize(20) for i in Tile.instances: if i.tags[0] in range(256): pos = getGridPos(i.listx,i.listy) outline(i.tags[0],pos[0]+length/2,pos[1],4,0xffffbf00) for i in Wire.instances: for j in i.inside: pos = getGridPos(j.listx,j.listy) outline(i.power,pos[0]+length/2,pos[1],4) for i in Gate.instances: if type(i.operate) == int: pos = getGridPos(i.am.listx,i.am.listy) outline(i.operate,pos[0]+length/2,pos[1],4,0xff008876) else: if i.outval != None: pos = getGridPos(i.am.listx,i.am.listy) for j in i.outputs: outline(i.outval,pos[0]+length/2+length*j[0],pos[1]-length*.3+length*j[1],4,0xff008876) textSize(30) if gamestate[4:] == '0': outline('Connect power tiles to the generator',250,450,4) elif gamestate[4:] == '1': outline('"&" boxes combine colors',250,470,4) elif gamestate[4:] == '2': outline('Press & hold 9 to delete entire wires',250,485,4) elif gamestate[4:] == '3': outline('This box only lets one input through',250,470,4) elif gamestate[4:] == '4': outline('Press space to view',250,430,4) outline('the hue values of colors',250,470,4) elif gamestate[4:] == '8': outline('All inputs of a generator',250,450,4) outline('must be powered',250,480,4) elif gamestate[4:] == '15': outline('Press 2 to place wires',250,485,4) elif gamestate[4:] == '16': outline('It connects to the newest node',250,430,4) outline('of the newest wire',250,470,4) run()
circuitboard.py
( around 834 lines python code )
Published By:
luyfru
Published on
2024-06-06T23:35:03Z
Python Mini
- an
OYOclass
application,
own your own class today
.
Run
Result
×
Error message shows here