Boa tarde galera, eu sou novo no fórum e iniciante na linguagem R, mas preciso fazer um jogo da velha porém estou com duvida de proceder após realizar a matriz, alguém poderia me ajudar, ou me mandar um site para eu me basear?
Oi Guilherme, tem um pacote para isso: https://github.com/kota7/tictactoe
Exemplo:
# instalar o pacote
install.packages("tictactoe")
# carregar o pacote
library(tictactoe)
# jogar humana vs computador/R
ttt(ttt_human(), ttt_ai())
# A B C
# ------
# 1| . . .
# 2| . . .
# 3| . . .
#
# Player 1 (no name) to play
# choose move (e.g. A1) > a1
# action = A1
# A B C
# ------
# 1| X . .
# 2| . . .
# 3| . . .
#
# Player 2 (ttt AI) to play
# action = B1
# A B C
# ------
# 1| X O .
# 2| . . .
# 3| . . .
#
# Player 1 (no name) to play
# choose move (e.g. A1) > c3
# action = C3
# A B C
# ------
# 1| X O .
# 2| . . .
# 3| . . X
#
# Player 2 (ttt AI) to play
# action = C1
# A B C
# ------
# 1| X O O
# 2| . . .
# 3| . . X
#
# Player 1 (no name) to play
# choose move (e.g. A1) > b2
# action = B2
# game over
# A B C
# ------
# 1| X O O
# 2| . X .
# 3| . . X
#
# won by Player 1 (no name)!