I didn’t complete all my stories in my IPM for the first time this week. I dreaded this IPM all week because of it. Failure is a part of life, but not something I’m willing to accept without trying everything that I can to not fail. So I put in a little over 70 hours in the last week not including writing these blog posts. Even though I know I tried my best it still sucks to fail.

But this week is a new week, and I should stop looking in the past about it. So it’s time to just look towards this upcoming week and break my defeated mindset.

3 Dimensional Tic Tac toe

This week’s new task is to update my tic-tac-toe board to play in 3 dimensions. This one took me a second to wrap my head around, so I figured it was worth writing a blog post to explain it.

Instead of just the two-dimensional board we have been playing on before, there will now be two more of those boards. These boards will effectively be overlain each other in the sense that now wins will take into account rows, columns, and diagonals from all boards together.

The best way I have brainstormed of creating the board for this is to create a sequence of 3 boards.

I will then be able to refer to each “cube” with an x and z value.

(repeat 3 (vec (range 9)))
=>
([0 1 2 3 4 5 6 7 8] 
 [0 1 2 3 4 5 6 7 8] 
 [0 1 2 3 4 5 6 7 8])

The value would show me which board, the x value can select which position on that board. All of my win conditions I currently have should still work on this board for each layer, but I’ll have to write some additional checks to see if there are any matches across boards also.