chess_game/chess_com.py
2022-11-15 14:48:42 +01:00

41 lines
783 B
Python

#task make a chess game
'''to know :
value of a pwan : 1
value of a knight : 2
value of a bishop : 3
value of a rook : 5
value of the Quenn : 9
value of the King : 10 '''
piece = [(1,2,3,5,9,10)]
import numpy as np
def chess_board_empty(): #affiche le plateau d'echec sous forme de matrice 8*8 vide
board_empty = np.zeros((8,8))
return board_empty
print(chess_board_empty())
def chess_board():
board_empty = chess_board_empty()
n = range(len(board_empty))
m = range(len(board_empty[0]))
for i in n:
for j in m:
if i == 0:
board_empty[j] = piece[j]
if i == 1:
while j<m:
board_empty[i][j] = piece[1]
return board_empty
print(chess_board())