This topic is for listing and review of Tic Tac Toe Game projects built as a part of FCC challenges. Please stick to these basic rules to keep the topic clean:-
Post your Codepen (or other) link to your project as a general reply to this topic.
For Codepen links use the following format to avoid embedding the pen:-
Project Link - [http://codepen.io/santakmishra/full/pgqOYq/](http://codepen.io/santakmishra/full/pgqOYq/)
Post reviews as a specific reply to the link which you are reviewing.
Hi kire73 When im choosing left edge, than uper edge than left top corner than bottom left corner i win, i think you should reconsider computer strategy.
Thought this project would be a cake-walk when I began… simple table, formatting, event processing… how hard could that all be? Ha! The AI near-killed me! But it was worth it!
Nice job with the AI. I am still tying to figure out how to write the minimax algorithm. Any suggestions for resources?
Small suggestion for yours - at the beginning, before you choose x or o, it seems like you should be able to click but you cant because of the hover effect. I think it would be more intuitive if there was no effect, or if you were already assigned a default letter and had the option of switching later.
I love the layout and user experience. intuitive and worked as expected. The AI could use a little work, it felt like the computer player was trying not to win. I really like that you can play a friend and that it automatically lets the loser of the last game go first.
Homegrown AI put together by trial and error. Easy level is basically randomly selecting squares unless there is a blocking or winning move available. Good mode puts some more logic into it, but still has vulnerabilities. Expert mode has everything I could come up with to force a tie or loss.
Took a very, very long time to get the minimax algorithm right, but I think I’ve got it.
UI is very basic. If the player selects to play as O the algorithm has to run through every single possible game state to make a move, but then always chooses the top-left square. There must be a way to make that more efficient.
You could write some code so that if the algorithm is making the first move of the game, it automatically picks the upper left corner. Or you could pick any random corner as a first move. If Minimax is coming back with a corner as the best clear-board first move, it really doesn’t matter which corner you start with. You only really need to start running boards through Minimax once the player has placed a piece, giving you an unknown board state.