Learn to program Python using a Logo-like turtle
learnpython.org
Tell me what you think. Thanks!
learnpython.org
Tell me what you think. Thanks!
What the world needs is an approachable version of a system like the image manipulation presented in Structure and Interpretation of Computer Programs, which takes a functional approach. (It may have only been in the first edition, but it is covered in the Hewlett-Packard videos.)
I'm not a functional programming absolutist, but experience has taught me to think functionally by default. The habit should be instilled in would-be programmers as early as possible.
All IO is inherently impure, right? At best you're going to be composing funtions out of smaller functions that implement your graphics desires.
How can you get around having e.g. a circle(radius, x-pos, y-pos, line-color, fill-color) function that draws per your specifications? There's no reason you couldn't implement that circle function using turtle...
Long story made short - I ended up choosing Python. Intuitively, I strongly resisted this conclusion. But in the end, it made sense: the syntax is clean (some would say too rigid, I say that's okay for a teaching language), it's pretty hard to obfuscate the code (unlike Perl), you can do "import turtle" and voila it's Logo, and there are plenty of tutorials and books geared towards beginners including young children.
We had lots of fun doing things like:
>>> import turtle
>>> t = turtle.Pen()
>>> t.forward(50)
>>> t.left(90)
>>> t.forward(50)
I showed him variables, a little bit about strings and lists. Next up: loops, if/else, etc.
I'm following this book:
http://www.briggs.net.nz/log/writing/snake-wrangling-for-kid...
Giving commands like "turtle.forward(10)" opens an asynchronous tk window showing the "turtle" (an arrow, really) and a line where it has passed. The window remains open, the focus goes back to the python interpreter, and you are free to type new commands.