from enum import IntEnum class Cells(IntEnum): BLANK = 0 BLACK_CHIP = 1 WHITE_CHIP = 2 WALL = 9 board = [ [9,9,9,9,9,9,9,9,9,9], [9,0,0,0,0,0,0,0,0,9], [9,0,0,0,0,0,0,0,0,9], [9,0,0,0,0,0,0,0,0,9], [9,0,0,0,1,2,0,0,0,9], [9,0,0,0,2,1,0,0,0,9], [9,0,0,0,0,0,0,0,0,9], [9,0,0,0,0,0,0,0,0,9], [9,0,0,0,0,0,0,0,0,9], [9,9,9,9,9,9,9,9,9,9], ] ## Display game board for y in [0,1,2,3,4,5,6,7,8,9]: ## ← range(0, 10)と等価 for x in [0,1,2,3,4,5,6,7,8,9]: ## ← range(0, 10)と等価 if board[x][y] == Cells.BLANK: print("・", end="") elif board[x][y] == Cells.BLACK_CHIP: print("●", end="") elif board[x][y] == Cells.WHITE_CHIP: print("○", end="") elif board[x][y] == Cells.WALL: print("■", end="") print()