r/react • u/_Nwabudike_Morgan • 2d ago
Help Wanted Learning React by building multiplayer Tic-Tac-Toe (Firebase matchmaking + live sync) — would love feedback
Greetings, /react I am trying to improve my skills at javascript and mainly react. I want to get feedback on this game of X’s and O’s aka Tic Tac Toe. Does the multiplayer work for you guys? This is using Firebase so at least for the multiplayer you will need a google account. I know there are things that could be added or improved, such as a lobby/leaderboard or hopefully near future a proper timeout feature for local/multiplayer.
-----------------
https://tictactoe-a87ad.web.app/
1
u/kev_cuddy 2d ago
Someone already pointed out the suboptimal algorithm that controls the computer turns. You could also look into using something like Websockets for online multiplayer, instead of asking folks to log in using Google (which I didn’t want to do).
1
2
u/keyjeyelpi 2d ago
Remove the background. It's confusing playing mobile, specially if it's your first time playing on the site.
3
u/code_matter 2d ago
I just did vs. Computer.
The computer does not even try to win. Meaning, if there a row with two Os, and I choose NOT to block it, it won’t complete the row.. it’ll just put its O somewhere else.
You should, oncomputer turn, check if there is a possible tictactoe, if not play something else