class pony: initial = True def __init__(self,is_true): self.numer = is_true class chess: def __init__(self,play): if play==1: self.play = True class piece: def __init__(self,name,value): self.name = name self.value = value class square: def __init__(self,x,y): self.x = x self.y = y def piece_here(self,p): self.p = p class board: king = piece('wk',40) queen = piece('wq',9) rook1 = piece('wr',5) rook2 = piece('wr',5) bishop1 = piece('wb',3) bishop2 = piece('wb',3) knight1 = piece('wn',2) knight2 = piece('wn',2) A = piece('wp',1) B = piece('wp',1) C = piece('wp',1) D = piece('wp',1) E = piece('wp',1) F = piece('wp',1) G = piece('wp',1) H = piece('wp',1) e = piece('--',0) bH = piece('bp',-1) bG = piece('bp',-1) bF = piece('bp',-1) bE = piece('bp',-1) bD = piece('bp',-1) bC = piece('bp',-1) bB = piece('bp',-1) bA = piece('bp',-1) bknight2 = piece('bn',-2) bknight1 = piece('bn',-2) bbishop2 = piece('bb',-3) bbishop1 = piece('bb',-3) brook2 = piece('br',-5) brook1 = piece('br',-5) bqueen = piece('bq',-9) bking = piece('bk',-40) a1 = square(1,1) a2 = square(1,2) a3 = square(1,3) a4 = square(1,4) a5 = square(1,5) a6 = square(1,6) a7 = square(1,7) a8 = square(1,8) b1 = square(2,1) b2 = square(2,2) b3 = square(2,3) b4 = square(2,4) b5 = square(2,5) b6 = square(2,6) b7 = square(2,7) b8 = square(2,8) c1 = square(3,1) c2 = square(3,2) c3 = square(3,3) c4 = square(3,4) c5 = square(3,5) c6 = square(3,6) c7 = square(3,7) c8 = square(3,8) d1 = square(4,1) d2 = square(4,2) d3 = square(4,3) d4 = square(4,4) d5 = square(4,5) d6 = square(4,6) d7 = square(4,7) d8 = square(4,8) e1 = square(5,1) e2 = square(5,2) e3 = square(5,3) e4 = square(5,4) e5 = square(5,5) e6 = square(5,6) e7 = square(5,7) e8 = square(5,8) f1 = square(6,1) f2 = square(6,2) f3 = square(6,3) f4 = square(6,4) f5 = square(6,5) f6 = square(6,6) f7 = square(6,7) f8 = square(6,8) g1 = square(7,1) g2 = square(7,2) g3 = square(7,3) g4 = square(7,4) g5 = square(7,5) g6 = square(7,6) g7 = square(7,7) g8 = square(7,8) h1 = square(8,1) h2 = square(8,2) h3 = square(8,3) h4 = square(8,4) h5 = square(8,5) h6 = square(8,6) h7 = square(8,7) h8 = square(8,8) h8.piece_here(brook2) h7.piece_here(bH) g8.piece_here(bknight2) g7.piece_here(bG) f8.piece_here(bbishop2) f7.piece_here(bF) e8.piece_here(bking) e7.piece_here(bE) d8.piece_here(bqueen) d7.piece_here(bD) c8.piece_here(bbishop1) c7.piece_here(bC) b8.piece_here(bknight2) b7.piece_here(bB) a8.piece_here(brook1) a7.piece_here(bA) a1.piece_here(rook1) a2.piece_here(A) b1.piece_here(knight1) b2.piece_here(B) c1.piece_here(bishop1) c2.piece_here(C) d1.piece_here(queen) d2.piece_here(D) e1.piece_here(king) e2.piece_here(E) f1.piece_here(bishop2) f2.piece_here(F) g1.piece_here(knight2) g2.piece_here(G) h1.piece_here(rook2) h2.piece_here(H) square_list ={a1:1,a2:2,a3:3,a4:4,a5:5,a6:6,a7:7,a8:8,b1:9,b2:10,b3:11,b4:12,b5:13,b6:14,b7:15,b8:16,c1:17,c2:18,c3:19,c4:20,c5:21,c6:22,c7:23,c8:24,d1:25,d2:26,d3:27,d4:28,d5:29,d6:30,d7:31,d8:32,e1:33,e2:34,e3:35,e4:36,e5:37,e6:38,e7:39,e8:40,f1:41,f2:42,f3:43,f4:44,f5:45,f6:46,f7:47,f8:48,g1:49,g2:50,g3:51,g4:52,g5:53,g6:54,g7:55,g8:56,h1:57,h2:58,h3:59,h4:60,h5:61,h6:62,h7:63,h8:64} Bee = [[5,1,0,0,0,0,-1,-5],[2,1,0,0,0,0,-1,-2],[3,1,0,0,0,0,-1,-3],[9,1,0,0,0,0,-1,-9],[40,1,0,0,0,0,-1,-40],[3,1,0,0,0,0,-1,-3],[2,1,0,0,0,0,-1,-2],[5,1,0,0,0,0,-1,-5]] B = board() player = chess(2) jonesonie = pony(1)
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question