To be totally fair, I actually made this a few months ago to show to students at a Career Day fair. It's build with a containerized JavaScript pattern using jQuery. I tried to make it a bit smarter by having the game actively block the player from winning and take squares it knew would win. Certainly added a lot of work but was well worth it. I went with my favorite "break down important or repetitive tasks into separate functions and invoke those when needed" style of mine. It makes for longer code but also more readable and maintainable for me, and it helps strike the right balance of efficient and clear for when I write.
I also wrote a personal blog post about the JS containerization pattern if anyone's interested/shameless self-plug - maxwellantonucci.com/2017/05/29/st...
BOOM
codepen.io/max1128/pen/JNbyaL
To be totally fair, I actually made this a few months ago to show to students at a Career Day fair. It's build with a containerized JavaScript pattern using jQuery. I tried to make it a bit smarter by having the game actively block the player from winning and take squares it knew would win. Certainly added a lot of work but was well worth it. I went with my favorite "break down important or repetitive tasks into separate functions and invoke those when needed" style of mine. It makes for longer code but also more readable and maintainable for me, and it helps strike the right balance of efficient and clear for when I write.
I also wrote a personal blog post about the JS containerization pattern if anyone's interested/shameless self-plug - maxwellantonucci.com/2017/05/29/st...
Hell yeah
Damn! That's hard core!