79156309

Date: 2024-11-04 16:51:00
Score: 1
Natty:
Report link

Here's a variant on variable-controlled arrays

import numpy as np import os

def set_Matrix (): row = int(input("Enter how many Rows you want : ")) col = int(input("Enter the number of columns : ")) global matrix mx = np.array(['']) one_d = (row * col) - 1 for x in range(0,one_d): mx = np.append( mx, ['']) print(mx) matrix = mx.reshape(row,col)

def place_x(row,col,value): matrix[row,col] = value

def place_o(row,col,value): matrix[row,col] = value

os.system('cls') # Windows command set_Matrix() place_x(3,1,'X') place_o(0,1,'O') print('Matrix : \n',matrix) print("Tic Tac Toe range :", matrix.shape)

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Dexter Greener