Apr. 26th, 2012

izard: (Default)
I just had to lead a one hour programming lesson for a small group of 14 year old girls who know nothing about programming.

So what I did was I've taken a Qt snake game demo (very similar to a game installed on many Nokia phones), removed few lines from a Javascript file that contains the games logic (Qt/demos/declarative/snake/content/snake.js), and guided students in re-creating the parts I removed.

I only explained that we have two sets of Cartesian coordinates (one for human, one for AI player) which we can alter each time tick, and told them they can use assignments and checking conditions with <, >, ==.

I think this is a very visually appealing and interesting exercise with easily adjustable complexity.

diff is under cut.
Read more... )
Three places to check are marked with FIXME. First place is logic to move a snake, good to start. Second is a hack to make it easier to debug.

Third is the really interesting part, because here students can invent a strategy, algorithm and code for AI player. The girls I worked with, who had never programmed before, managed to write an AI player that chases and catches human one :) It was running on a netbook and CE4100 Atom based set top box

Profile

izard: (Default)
izard

November 2025

S M T W T F S
       1
2345678
910 1112131415
1617 1819202122
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Nov. 30th, 2025 05:25 am
Powered by Dreamwidth Studios