Here's a simple implementation of tic-tac-toe game using MATLAB:
main.m1320 chars58 lines
The code creates a 3x3 tic-tac-toe board using 2D array. The players enter the row and column number to make their move. The program checks if the entered cell is empty, and if it is, the program updates the board and checks if the player has won or not. If there's no winner after all cells are filled, the game ends in a draw.
gistlibby LogSnag