Python Exercises for Kids
blog.regehr.org
blog.regehr.org
I would develop screen savers (Lines floating on the screen, lines being drawn randomly on screen, ball bouncing off the edges of the screen, flying into a star-field as the stars move away from the center of the screen), and show them off to my friends and family. I would develop a small game (spaceship moves up and down to avoid hitting incoming asteroids) - I'd show it to my friends. Let my brothers play the game.
These were the type of rewarding tasks that led me to keep on learning and experimenting.
If you're doing Python - I strongly recommend "Inventing computer games with python" https://inventwithpython.com/ Using pygame, you can get really quick graphical results, and start showing off some awesome things. I even built a Tetris game based on pygame a while back when I was learning python myself.
Also - if you're doing turtle programming, check out http://pythonturtle.org/ - an awesome implementation of turtle graphics for python.
When I got older I did a few things in C, but didn't get the chance to go too deep much into it because when I started university at 18 I pretty much stopped programming for fun, until my graduation project began and I got in touch with Python.
My neatest trick at that point was to make a 'fake' pre-loader where the progress bar showed a fake percentage with a cool graphic. My next 'impress project' was build a menu in QBasic where you could use the arrow keys on the keyboard to graphically move the highlighter on a menu. Almost everyone else at that time was doing menu selection pressing the number of the menu item. At that point I thought of it myself since there wasn't any internet in our lab so I still feel really good about it :) It also got me a spot on our school programming team primarily because no one else did the menu as quickly as I could then.
I'd like to think that I'm an interaction designer today partly because of the feedback and enjoyment I got out of doing projects like that.
Scratch (https://scratch.mit.edu/) helps a bit but it's still "stuck in front of a screen" and reaching a "reward", in terms of a meaningful result takes longer than the average childs attention span.
Best starting point I've ever seen is this "How to Train your Robot" real world game - https://drtechniko.com/2014/07/09/teaching-the-how-to-train-... - which is based on the idea that adults play the robots and kids get to tell them what to do. That's immediately a fascinating starting point for kids to hold their interest while they pick up some basic ideas of logic and creating instruction sets for a 3rd party to execute.
The 'How to Train your Robot' game appears to be aimed at a 2.5 year old and as the mother of a 2.5 year old myself, it seems ludicrous to try to get a child that age into programming.
On the other hand, my 5 year old needs something more than directing robots around - Robot Turtles is too easy now for example, but he does enjoy playing with ScratchJr on the iPad, sometimes for quite long periods of time. It also of course has the big advantage at this age of not requiring literacy.
I've found it works best as a party game with a group of kids where it can have a competitive dimension - whoever can "write a program" to get the "robot" to achieve some goal fist e.g. navigate an obstacle course and pick up an object. Even better when kids are in pairs; one pair might focus on winning, another pair might get absorbed on getting the adult to do stupid things which is hilarious etc.
And from what I've seen it can be fun for kids up to 10 at least, if you add some additional dimensions e.g. "robots" that can "fight" by throwing rolled up paper balls at other.
It also gave you a way to combine a set of instructions into what was essentially a function/method so that you could then call the function/method instead of retyping all the steps. My kid was too young at the time but now that he's older I can't find it or it was never updated.
Anyone happen to know of this app, or something similar?
Some stuff kids would enjoy more: https://inventwithpython.com/ http://www.amazon.com/Python-Kids-Playful-Introduction-Progr...
The problem I've found with pygame is that the time from starting to producing a playable game is too long, the kids get frustrated and lose interest when you need to type 20-40 lines of boiler plate to just get an image and a moving character on the screen before anything even happens. I've had much greater success with "boring" projects that produce the final result in 10-20 lines.
They already have games that we'll never be able to come close to in terms of quality. There's nothing that I can make in even 20 hours that is even close to as interesting as Minecraft or a high budget xbox game - there is effectively a very small difference to them between building a game with "boring" dynamics and solving math problems.
This mostly only applies to first projects, once you complete a few projects and have separated out the children who actually enjoy programming - that's when you can start doing multi-week epics. But you need to build confidence and give them some easy "wins" before you are going to be able to do that in my experience.
The boiler plate should just be hidden away if possible.
I think a small coding exercise that kids would like is something that automatically solves their simple algebra homework. Although, do 12 year olds just go on wolframalpha now?
I don't think recursive tree algorithms and reverse Polish notation, the bedrock of computer algebra systems, would be so much fun to kids. Could you elaborate on what you had in mind?
But for kids today, I see these problems:
- Haven't seen anything that gives the simplicity and ease of use for graphics that my old Spectrum had. This is what pygame should be providing, but I agree with you that it is actually pretty disappointing in this regard; I find its API a bit cumbersome and nonintuitive, although others' mileage may vary.
- Modern 3D games set the bar very high, and it's difficult to get kids to understand that they need to aim much lower to get going. And whereas the maths required to write a 2D game is pretty basic first principles stuff, 3D is a whole discipline that needs to be learned.
- Scratch is fun, but very limiting and, if you have a lot of stuff going on, really unplayably slow. My daughter has fun doing little animations in it, but it needs a better object system IMO in order to be able to allow users to push on with it.
One of the more popular exercises thus far for us has been the "Bagels" program. I can't even remember where I found the game, but they find it a lot of fun as it mixes a bunch of mental challenges into one program.
http://justbartek.ca/python-curriculum/exercises/bagels.html
[1] http://www.ccs.neu.edu/home/matthias/HtDP2e/part_one.html#%2...
The fractals need only a few lines of code, with a bit of extra boiler plate. Tweaking the formula can give dramatically different results. You get to use a variety of programming concepts in a short program.
Relevant books are
Dynamical Systems and Fractals (Karl-Heinz Becker, Michael Dörfler) (This book has extensive Pascal code) http://www.amazon.co.uk/Dynamical-Systems-Fractals-Computer-...
http://ebooks.cambridge.org/ebook.jsf?bid=CBO9780511663031
Fractals - Images of Chaos (Hans Lauwerier) (This book has an appendix of BASIC code) http://www.amazon.co.uk/Fractals-Images-Chaos-Penguin-Scienc...
Sadly neither book is suitable for general 11 year olds, but a modern version certainly could be.
And A.K. Dewdney obviously has a bunch of books which could be used to inspire young programmers. The Armchair Universe, or The Magic Machine and similar launched many programmers, with "Core War", "Wator", "Bugs", etc
Or a text-based adventure to teach arrays. They build the map, then move through it in the same manner.
These exercises can be too tough for a 50 year old beginner, and a 15 year old can breeze through them.
python exercises for kids? their math homework
Although now that I think about it, I think I'd trust a 13-year-old with a fresh mind more than most of the college students I work with.