TICTACTOEI was recently asked to take on a (15-year-old) student for programming by a family friend so I decided the best place to start was Processing. I need to say this right now before I get emails, tweets and various comments, this isn’t the best code in the world as it was gradually built upon and when we started we had no idea what we were going to make. It was a brilliant day and I think he learned quite a lot. Although he knows a fair bit about computers, he runs his own “Minecraft” server and a bit about HTML he hadn’t done any programming like this before.

We started with variables.


and moved on to arrays, multi-dimension arrays, then to booleans and so on.

We then learnt how to draw

//Makes background black
//Makes the drawing colour white
//Fills in shapes with the colour white

//Draws a nice box
line (10,10,290,10);
line (290,10,290,290);
line (290,290,10,290);
line (10,290,10,10);

Gradually the plan moved to turning the box into a grid and the plan was to make a TIC TAC TOE game. We then moved on to “for” loops and loops within loops and then functions. This function clears the board.

void clearBoard(){
for (YPOS=0; YPOS<3; YPOS++){
for (XPOS=0; XPOS<3; XPOS++){

We also covered conditionals i.e. ifs and else ifs, this checks for the reset button press.

if (mouseX > 76 && mouseX<223 && mouseY> 322 && mouseY <400){

All in all it was a good four hours of tutoring and I think he was amazed at how these little blocks of code can be put together, you can see the code here and the full .zip file with all the assets here.  We plan to finish the game next Friday, this code does look and finds a winner it just doesn’t do anything with that information yet. We will also try and make it into a web app if possible, well see.