wiki-media
Training and Development

Teaching an (adult) child to code: Part II

The UK government has made coding a core part of the school curriculum. In an effort not to look thick and play with some toys, Dan Swinhoe documents his trials and tribulations of learning to code using Kano, a Raspberry Pi kit for kids…

Day 4: In which we make Snake

Our office has been inundated with Chocolate Buttons, so to add impetus/embrace positive reinforcement, I will be rewarding myself with those sugary, round discs of goodness for every small victory. Lesson 1 is simple – we’re making Snake. This should be easy; I had a Nokia 3310, I’m an expert at Snake. Let’s have a chocolate button to calm the nerves.

We open with a quick basic game of snake. I don’t get a great score, but it’s ok, I’m out of practice [1 chocolate button for trying]. You don’t build the whole game from scratch, you simply type commands to bring the game up onscreen and understand the general logic of coding. Step by step you change different aspects of the game and then test it out; you make the game area bigger/smaller [1 button], add lives [1 button], make it faster/slower [1 button], change the appearance [2 buttons] for each step you’re given a bunch of points.

And then it happens. I went up a level! I gained a new avatar! Badges! [I just took a whole handful of buttons here].

trees-theme

As it’s the first lesson, you’re babied through step by step. At this point it’s just about learning how the logic of coding works. But it suddenly gets all exciting when we’re cut loose and given free rein; a big area, a fast snake, a cool aesthetic with lots of lives – still a rubbish score. Oh. Maybe I’ve lost my touch. I’ll have some more buttons to make myself feel better.

Day 5: The real test

Can I remember anything I learned the following day? It’s all well and good following the instructions when they’re in front of you, but has any of it stuck enough to be useful later? It seems so! I can remember the various commands and parameters without too much difficulty. There’s an option to bring up all the commands, but the only time it’s really needed is to bring up the names of the different aesthetic themes since they’re case sensitive and I can’t remember what I called my awesome theme.

Overall: A Success! I might not be able to code, but it feels like I’m well on the way.

Kano Level: 3

Number of Chocolate buttons eaten: Approx. 10 [at least; probably more]

Day 6: In which we make Pong

Making Pong steps thing up a notch by including building blocks – you start with a block for your ball then jigsaw pieces affecting size, speed and colours. In round two you then add a block focusing on background colours. Cue failure where the ball is far too fast for the slow paddles and the colours I pick clash so no one can see what’s going on [no buttons for basic gameplay failures].

2014-12-18-14

After messing about with colours and names and finally settling on a colour scheme that doesn’t offend the eyes, things get interesting with the addition of logic. The first few basically involve cheating; if key pressed = A, player 1 Wins; If key pressed = W, ball flies off in the other direction. But it’s fun and I win a badge [2 Buttons – one for logical thinking, one for earning a badge].

I add a parameter for victory, and after a hard fought 3-1 Victory, I earn another achievement for using 100 blocks [definitely time for more buttons]. Next comes randomizing; every time the ball touches a player, the colours change randomly. It’s wild. Colours everywhere. I also add the option that I turn red after 5 points, ‘cos I’m adventurous like that.

I change the ball size and speed, making the paddles gradually smaller, adding a second human player. Once I’ve gone through all the different ways to play, I’m given free rein to go wild [More badges! More Levels! Chocolate buttons galore here]. While I’m still not learning to actually code, I’ve been taught some nice lessons about logic; don’t make the ball twice as fast every time you hit it unless you include a reset after a goal. It goes wrong quite quickly.

2014-12-18-14

The complexity has stepped up from the basics of snake to the surprisingly challenging (but rewarding) demands of Pong, but there’s plenty of hints, suggestions and walkthroughs if needed.

Overall: A success! I still can’t code, but I’m definitely getting closer.

Kano Level: 5

Number of Chocolate buttons eaten: 20+ [I have a problem]

Tune in for part three soon, where we play Minecraft!

PREVIOUS ARTICLE

« Box readies 22 January IPO

NEXT ARTICLE

Will the boomerang effect prompt e-tailers to rethink returns? »
author_image
Dan Swinhoe

Dan is a journalist at CSO Online. Previously he was Senior Staff Writer at IDG Connect.

  • twt
  • twt
  • twt
  • Mail

Recommended for You

Trump hits partial pause on Huawei ban, but 5G concerns persist

Phil Muncaster reports on China and beyond

FinancialForce profits from PSA investment

Martin Veitch's inside track on today’s tech trends

Future-proofing the Middle East

Keri Allan looks at the latest trends and technologies

Poll

Do you think your smartphone is making you a workaholic?