Day 53 – Tic Tac Toe

To be honest, the process of writing this page was hard. Tic Tac Toe is such a simple game that I thought I would be able to code it easily. Instead I found myself confused. If I gave each box on the game board an id, should I get the id upon every click and then compare with all the other pieces on the board? How do I set the “winning patterns” to check for? I overcomplicated things for myself and found writing Tic Tac Toe to be frustrating because while I thought it was a simple task, it took me more effort than anticipated.

Something like this can lead you to doubt your own abilities and I found a fixed mindset voice in my head saying “if you had any talent, this would be easy” and “you can’t even code such a simple thing?” Although I shipped production code for the very first time last Friday (hooray!), this small page caused doubt on my own progress. I just have to keep telling myself, “growth mindset!” If there’s something I don’t know, I can learn it. It’s ok if it takes me longer, because the next time it will be a little bit easier.

The way I set it up was to create an empty board in JavaScript and place user choices on the board (only allowed if that box on the board is empty). After each placement, I would check if that player had any winning patterns on the board. This Tic Tac Toe game is for two players.
Screen Shot 2015-03-27 at 10.08.41 PMDay 53 – Tic Tac Toe

Advertisements

2 thoughts on “Day 53 – Tic Tac Toe

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s