Tic Tac Toe

버전 1.1.0.0 (6.55 KB) 작성자: Suleman Shafqat
交易ditional tictactoe game, using Graphics User Interface.

다운로드수: 3.9K

업데이트 날짜:2011/3/24

라이선스 보기

A 2D matrix is declared and initialized with zeros, as any player turns, the corresponding 1 or 2 is written in the matrix.
After each turn the matrix is checked in function "whowins.m", with any number (1 or 2) coming three in line, that number is returned other wise '0', if -1 is returned it means its a draw.

winning logic simply checks all possible options a player can win and the corresponding function is called after each turn.
The 2D array is updated each turn and whowins.m is checking that for all three cases (player 1 wins, player 2 wins and Draw)

인용 양식

Suleman Shafqat (2022).Tic Tac Toe(//www.tianjin-qmedu.com/matlabcentral/fileexchange/30633-tic-tac-toe), MATLAB Central File Exchange. 검색됨.

MATLAB 릴리스 호환 정보
개발 환경: R2009b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
도움

줌:3 Player TicTacToe

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!