[Edu-sig] Pygame etc.

Edward Cherlin echerlin at gmail.com
Sat Jun 28 01:11:32 CEST 2008


2008/6/19 kirby urner <kirby.urner at gmail.com>:
>> Schoolchildren in the One Laptop Per Child program are writing
>> graphical games in PyGame.
>>
>> http://wiki.laptop.org/go/Pygame
>> http://www.olpcnews.com/content/games/laptop_game_jam.html
>>
>
> Of course there's a lot of mythology about what schoolchildren are and
> aren't doing out there in the misty mountains of Peru or whatever,
> maybe getting Pippy booted up, reading about Fibonacci numbers,
> Pascal's triangle, turning to generator-based versions.

That's why I prefer to point people to real reports where they can, if
they like, talk to some of the people concerned. We have a few Wiki
pages now, notably http://wiki.laptop.org/go/Experience. Most of the
material there is pre-XO, but new information is coming in. Also
http://wiki.laptop.org/go/Academic_Papers, which has field reports on
deployments in Ethiopia and New York City. They haven't gotten to
programming yet.

> In actual fact, Pygame is a rather low level API.

I was making a contrast with the ASCII games in the book described.
The children aren't ready for NumPy and SciPy, but that will come.

> But so much game action isn't about "superhuman speed" -- just plod
> along with your human user, 99% wait cycles, and you'll be fine.
>
> So it turns out to *not* be so oxymoronic, to have game bindings for a
> relatively slow but intelligent snake, other scripting languages also.

When Smalltalk first appeared, it took at least $10,000 worth of
hardware to run it. Now we are down to $188 for something that also
spends most of its time waiting between ticks.

> Guido, recall, was in a busy environment full of technophiles,
> familiar with ABC, when he went off to write Python on a Lisa.  His
> "end users" weren't children, but experienced computerists, maybe with
> foci in sciences, mathematics... die-hard nerds already, geeks, not
> newbies.

Guido is a contributing member of BayPiggies (San Francisco Bay Area
Python Interest Group) and a fan of the OLPC project. He came to my
presentation on the XO, where I had my son demonstrating Pippy. I met
Guido on a mailing list when we were both trying to compile Sugar on
Debian. Neither of us succeeded at the time, yet today there are Sugar
packages in Debian and Ubuntu, and Etoys has just been accepted
(although as non-Free, because Debian and Etoys people are unclear on
each other's concepts about the proper form for source code).

> This is what Arthur (previously on edu-sig, lots in the archive)
> really *liked* about Python, and he let us know he'd fight any effort
> to dumb it down, make it "kid friendly" in a condescending way (like
> Alice in his view -- which I defended, because I'm a cartoon nut, love
> the idea of PySpongeBob).

Dumb it down? Not going to happen. We're building a complete Python
IDE for use in Sugar. There is good experience going back more than 40
years of introducing capable programming languages (Logo, LISP,
Smalltalk, APL) in elementary schools. And by Logo I don't only mean
Turtle Art.

> Better to have kids come to love adult tools of the trade was his
> attitude -- even wait until they're adults if that's what it takes.**
>
> But of course no one wants to wait that long.  The dream has always
> been:  more computing power to those who want it, no matter how young.
>  We'll get XOs in utero (with mom's permission) if that's the genetic
> predisposition of the fetus (i/o hooks to umbilical cord?) -- a
> twisted geek fantasy I realize, OK to LOL.
>
> More seriously, Sugar itself is a lot like a Pygame creation, a 2D
> iPod-like interface with apps running as pie wedges, helping with the
> metaphor of finite memory (in a ring), but sure why not run several.
> This isn't a "toy" interface -- extremely futuristic in a direction I
> think we *are* set to go, Sugar a brilliant first draft of itself
> (with many forks and rebrandings as we go forward).  Python is very
> lucky to be getting such a workout, in the hands of so many masters of
> their craft.
>
> http://worldgame.blogspot.com/2008/04/more-on-interface-design.html
>
> Back to Python books, I think the web edition format is best during
> the transition,

Another project that comes out of OLPC is a complete redesign of the
concept of a textbook. A PDF is already better than a printed book if
your screen has adequate resolution (the XO does). For a start, PDFs
can be hyperlinked, with full-text search. But what can a textbook be
if every student has a computer with a known set of software
capabilities? Sugar includes a digital oscilloscope program with both
time and frequency domain display. How does that affect your physics
textbooks, or for that matter, teaching music? What else can we use it
for? What if all textbooks can assume the presence of Python with
NumPy and SciPy? What if we can embed Dr Geo in geometry books, or a
symbolic math engine in algebra, calculus, and science books? What if
Text-to-Speech is always available to read material out loud, whether
for those learning to read, or those who want to do something
hands-free under computer guidance?

Alan Kay does a great demo in which children are taught how to program
a car on the screen in Smalltalk, and shown what happens if you add a
constant increment to the speed of the car in each time interval. And
also tell the car to put a dot on the screen before moving. Then the
pattern of dots has well-known properties that the children can be led
to discover: The intervals are as successive odd numbers, which sum to
squares for the total distance travelled.

Good. Now get the children outside with the camera function on their
XOs enabled, and have them take a video of something being dropped
from the school roof. Take frames at some regular interval, overlay
them, and observe the locations of the object--the same pattern we got
from the uniformly accelerated car! So we can teach ten-year-olds
roughly how Galileo discovered the law of gravity for a uniform field.

Galileo didn't have software or a camera, or even a clock, or any
guidance. He had to slow the process down by rolling balls down a
groove in a piece of wood and cutting notches every so often so that
the ball would make a sound at each one. When he got the spacing
right, so the the intervals between clicks were the same, he worked
out the math from there. Of course he also worked out that uniform
motion horizontally compounded with uniformly accelerated motion
vertically gives you a parabola. We can demonstrate this trivially on
the computer, but it is more interesting to ask children to watch
water fountains, and to try to recognize the shape of the arc. This is
something that the Greeks could have done, but missed. Being
demonstrably smarter in a very specific way than Plato or Aristotle or
Appolonius of Perga (author of The Conic Sections) is a rare treat for
children.

> as all those print statements are about to switch over
> to functional format as in "print( jabber jabber)" -- intead of "print
> jabber jabber".  Why waste a lot of paper teaching newbies 2.x?  Of
> course they'll need to learn retro dialects once making the commitment
> to Python more professionally (a huge "if" in many cases -- as it
> should be), but there's no reason not to go with "state of the art" on
> intro.  That's a privilege of being a newbie:  no ties to the past, no
> obligations, free to cut to the head of the line in some ways (in
> terms of using the most up to date code).

We only have a few large deployments of XOs. Most will come after 3.0 comes out.

> Actually, now is a good time for CS departments to watch something
> special, as having a live, happy language also be such a moving target
> (a morpher, a transformer), in terms of jumping a chasm, from ASCII to
> Unicode, dropping cruft, sleeking out... that doesn't happen every
> day.  Most languages of Python's maturity are considered
> "quasi-frozen" by the time they get to this point.  "Shedding skin"
> wasn't an option, but Guido had this pre-announced break point (good
> model, now that we see the pay off).
>
> So those teaching "anthropology of computer language cultures" or
> whatever UC-type stuff, might use this as an opportunity, lots of
> interesting zine articles (adapted for-credit papers) just begging to
> be written (and published even!).
>
> Kirby
>
> PS:  the Europython list is making me homesick for Vilnius,

My grandfather was from Vilnius. You might like to check out Andrius
Kulikauskus's Minciu Sodas, which is based there.

> I should
> sign off rather than read about taxi cabs from the airport, but
> actually no, I'd rather stay tuned, plan to visit her again someday.
>
> ** Arthur was a financial sector guy near what used to be called the
> Pan Am building when we first met, had some beers.  Much later we met
> up with Lansky and his boys, different part of Manhatten, had great
> free ranging talk on the meaning of liberal arts, C.P. Snow's chasm
> etc.  Arthur was a strong player, miss him on edu-sig (sudden heart
> attack, like Russert).
>
>>>> The book, in HTML and PDF format, and all the games are located here:
>>>> http://pythonbook.coffeeghost.net
>>>>
>>>> I'm planning on doing more books at some point in the future after getting
>>>> feedback.
>>>>
>>> First of all, thank you for your work and making this available.
>>>
>>> I first saw a link to your book on del.icio.us and read *quickly*
>>> through a few sections of a few chapters.  My first reaction was "hmm,
>>> no graphics ...  I wonder how that would interest kids nowadays...".
>>> However, after looking at the beginning of the last two chapters, I
>>> thought that this approach could very well work.
>>>
>>> Overall, it looked like a good progression of topics and something
>>> very much worthwhile.  Still, I think that it might be useful to
>>> include at least one graphics based game.  I would suggest to
>>> implement the Othello program using pyglet  (www.pyglet.org),
>>> introducing it at the very end.  Actually, I would have the kids
>>> download the finished Othello project and pyglet at the beginning,
>>> just to try it out, and point out that this is the game that they
>>> would be writing on their own at the end.

We could use an Othello in Sugar, and lots of other games. I have
books and books full of card games, board games, math games...African
games like Mancala and Mlabalaba, classic games like Go, any of the
games already available as Free Software...Anybody who is short of
ideas for themselves or for students can ask me about them. We also
need people to work on game infrastructure, like a collaboration
framework that supports viewing and kibitzing without the players
seeing the comments. Something that many online game servers provide
for chess, go, bridge...

>>> Just a thought...   I should read it more closely to give you some
>>> more detailed feedback.
>>>
>>> Cheers,
>>>
>>> André
>>>
>>>
>>>> Thank you!
>>>> Al Sweigart

-- 
Edward Cherlin
End Poverty at a Profit by teaching children business
http://www.EarthTreasury.org/
"The best way to predict the future is to invent it."--Alan Kay


More information about the Edu-sig mailing list