Hi, I just finished up my Tic Tac Toe game. It took me 132 hours. I learned a lot, but coding the different levels was grueling and tedious to say the least. I didn’t want to use the minimax algorithm as I felt the solution wouldn’t be my own, but after so much time spent I wonder if this is a better approach in general. I’m sure I’d learn a lot either way, but I’ve been continually astounded about how much time these projects take to build. The advanced projects are supposed to take ~140hrs total, and I spent that on TTT alone. I’m almost a year in to FCC, working on it nearly full time, and I’m only 1/3 of the way done with the curriculum. Anyway, any feedback is welcome, especially if you have any ideas on how to approach the project(s) more efficiently.
Thanks!
Very well done
Think you should also add some option to restart the game so you can choose different levels of difficulty without the need to reload the page.
In css as you have used a lot of ids that are unique instead of div#app{css code in here} you may just use #app{....}
Thanks for the feedback. I do need to try to redesign so it fits the screen better. The same problem happens on mobile.
Thanks, that is good feedback. I did wonder how to better design the restart function and what you suggest makes sense. Are any other areas screaming out DRY to you? I’d be curious how to cut out 300-400 lines of code!
Hi Randell,
I’m now working on the Simon app and running into the same issue trying to figure out how to reset the app in a DRY manner. I still don’t understand how to not duplicate when resetting. For example, when I initialize the app everything is set to their defaults in global variables ttt and winLines. As the game progresses, theses variable key values are overwritten, so calling reset on them then would result in resetting with the current state of ttt and winLines if it was just one object. So it seems like I do need to duplicate those objects to always keep a copy of the initial state available. I fell like I am still missing something in understanding how to write the init state only once and be able to reset and overwrite that same object. Can you help clarify what you meant by calling reset() at the beginning and how that would help eliminate code?
