4 ms·
I've done this in Chicago. You didn't specify their ages, I'm assuming these are high-school kids. The important point to stress, I think, is that computers and
by Jun8 14y ago
I've done this in Chicago. You didn't specify their ages, I'm assuming these are high-school kids. The important point to stress, I think, is that computers and programs are all around us, and not just as computers, either. Ask them to name a computer they use daily, then surprise them with the usage in dishwashers, cars, etc. (these are more microcontrollers but the distinction is not important).
From there you can go to the theme of "be a programmer of be programmed", i.e. everybody needs to know some coding. Tell them that math is not a prerequisite (a usual worry about programming) and show them some cool but simple game programming examples using Scratch, pygame and the like. In fact, it would be great if you can create a game during the presentation, with ~10 lines of code.
- ccallebs 14y agoSorry, they're middle-school aged. I should have specified. I think your advice is still applicable though.
- AlexCyrlex 14y agoJust out of curiosity, could you provide a link to a simple game written in ~10 (ten!) lines of code? My understanding was that for anything close to interactive game at least 50-100 lines of code are needed: to draw something, make it move and react to user input in a meaningful way. I am not familiar with frameworks such as Scratch or pygame; still 10 lines of code look like too few for a game.
- lsiebert 14y agoYou can do a simple terminal program in 10 lines. 10 commands probably not, but this is still fairly readable. in perl, a simple guessing game that runs in linux/unix #!/usr/bin/perl $SIG{ALRM} = \×up; my $random_num = int (rand(10)); print "Guess my number (0-9) in less than 10 seconds!\nGuess: "; alarm 10; while(1){ my $guess = <>; if ($guess == $random_num){alarm 0;print "You Got it! Well done!\n"; last; } else { print "Nope; guess again: ";} } sub timesup {die "Uh oh! Time ran out while waiting!\n";}