# -*- coding: utf-8 -*- # Robots Play Chess from numpy import zeros from random import randint from ChessUDF import placement, black, white, pawn # Parameters and Specifications ----------------------------------------------- board = zeros((8,8),dtype='U8') turns = 5 turns += 1 # Piece Placement ------------------------------------------------------------- temp = placement(board) board = temp # Dictionaries black = black() white = white() # Moves ----------------------------------------------------------------------- for i in range(1,turns): # White Goes First ######################################################## piece = 1 #randint(1,6) # pick one of the 6 white pieces if piece == 1: # pawn which = randint(1,8) # if there is more than one of that piece, which one? temp = pawn(board,white,which) board = temp[0] white = temp[1] elif piece == 2: # rook which = randint(1,2) pass elif piece == 3: # knight which = randint(1,2) pass elif piece == 4: # bishop which = randint(1,2) pass elif piece == 5: # queen which = 1 pass elif piece == 6: # king which = 1 pass # # Black Goes Second ####################################################### # b_piece = 1 #randint(1,6) # pick one of the 6 black pieces # if b_piece == 1: # pawn # which = randint(1,8) # if there is more than one of that piece, which one? # temp = pawn(board,black,b_piece,which) # board = temp[0] # black = temp[1] # elif b_piece == 2: # rook # which = randint(1,2) # pass # elif b_piece == 3: # knight # which = randint(1,2) # pass # elif b_piece == 4: # bishop # which = randint(1,2) # pass # elif b_piece == 5: # queen # which = 1 # pass # elif b_piece == 6: # king # which = 1 # pass