
Hi Wondering if anyone here has looked the latest PyGame? http://pygame.seul.org/ Looks like there is some very useful stuff in there - for example CDROM + Joystick drivers etc.. Could be useful for improving installations, tutorials, inteface Joystick to 3D graphics/Math functions, Lightflow, motivational progamming.. lots of blit functions for animation.. for teaching progamming using game context of analyis and design... The recent thread on CS now and in the good old days when computers were driven by rubber bands, reminds me that the prespetn metaphors of widgets and wodgets adn dominance of unimaginative, insanely complex GUIs and operting systems has tended to obsccure some of teh basic things about using computers. For example - when you look ata screen you are looking at a display. How does it get there? How do you change it etc.? I dont mean one shoull take the vacuum cleaner apart everytime you want tidy the house, but at least once in once life, preferably at an early age, take it apart and put it back together. Pygame seems interesting in that you can jump in making stuff and thinkning about logic or gameplay, but also can poke around lower level, deal with interfaces to physical and virtual devices.. some kids really enjoy that. PyGame is thoroughly cross-platform because it is based on SDL http://www.libsdl.org/ <quote> Simple DirectMedia Layer is a cross-platform multimedia library designed to provide fast access to the graphics framebuffer and audio device. It is used by MPEG playback software, emulators, and many popular games, including the award winning Linux port of "Civilization: Call To Power." Simple DirectMedia Layer supports Linux, Win32, BeOS, MacOS, Solaris, IRIX, and FreeBSD. SDL is written in C, but works with C++ natively, and has bindings to several other languages, including Ada, Eiffel, ML, Perl, and Python. [also jokes: A little girl had just finished her first week of school. "I'm wasting my time," she said to her mother. "I can't read, I can't write - and they won't let me talk!" ] </quote> Personally I have never been a game player, so I don't know about all this. They always bored me. Longest ever was couple of days with Sim City, and last summer for a day 'The Sims' with my niece, but I was fascinated by the idea of Sim City and what kind of stuff one could develop beyond it. My idea of computer games was alsways graphic software, music, Forth/Lingo/Python/Zope/Flash programming, etc.. First thing I ever did on my Amiga was bootup a version of Conways game of Life. Then went on to exploring realtime granular synthesis using RGS, and other magical soudn and graphic software written by a brilliant friend. You can read about them at http://www.echonyc.com/~jhhl/software.html I did not sleep much that first week I remember -- hooked me on computers.and wanting to learn how to program. My Amiga background tells me cross-platform multimedia library + Python abatraction interface is a GOOD thing. What's you opinion? - Jason ___________________________________________________________ Jason CUNLIFFE = NOMADICS['Interactive Art and Technology']

Hi,
Thanks Jason, your finds expand my horizons.
I dont usually post on this list, but PyGame really got my attention, so I would like to add my thanks as well. Safe hacking, - Lex Berezhny __________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/

Thanks to Dave Marain posting to math-learn@yahoogroups.com [1], the subject of Farey series arose, an ideal topic for those engaged in a "math + programming" curriculum using Python or other language (e.g. Scheme). Farey(N) is the complete list of reduced (lowest-terms) fractions between 0 and 1 inclusive, in ascending order, having denominators up to and including N.[2] For example, if N=3, then Farey(N) =
farey(3,'f') ['0/1', '1/3', '1/2', '2/3', '1/1']
The 'f' argument returns the list in 'fraction format p/q' -- including for 0 and 1. The default list (no 2nd argument) returns a list of tuples:
farey(3) [(0, 1), (1, 3), (1, 2), (2, 3), (1, 1)]
and the 'd' option returns floating point numbers, which are a little different from the decimals one would compute by hand, owing to the decimal->binary->decimal conversions that go on in floating point world:
farey(3,'d') [0.0, 0.33333333333333331, 0.5, 0.66666666666666663, 1.0]
One way to generate a Farey series is given in 'Concrete Mathematics' (Graham, Knuth, Patashnik): generate a Stern- Brocot subtree to the depth necessary in order to get all fractions of denominator N. The Stern-Brocot tree is formed by interpolating what are called mediants between every pair of terms in an expanding list. The mediant of p1/q1 and p2/q2 is simply (p1+p2)/(q1+q2).[3] So, starting with [(0,1),(1,1)], and interpolating a single mediant, you get: [(0,1),(1,2),(1,1)]. The next iteration gives you [(0,1),(1,3),(1,2),(2,3),(1,1)], and so on.
farey(7,'f') ['0/1', '1/7', '1/6', '1/5', '1/4', '2/7', '1/3', '2/5', '3/7', '1/2', '4/7', '3/5', '2/3', '5/7', '3/4', '4/5', '5/6', '6/7', '1/1']
This algorithm is guarenteed to reach all lowest terms fractions, and keeps them in ascending order to boot. The tree algorithm will pick of fractions of denominator > N in the process of getting all those with denominators <= N, so some filtering is required in the final step. The tree algorithm is defined as a separate function, to facilitate explorations independent of the Farey series connection, e.g. classroom discussion might focus on the fact that initial values of 0/1 and 1/0 will plant a tree that grows towards encompassing all positive lowest terms fractions, none missing, no duplicates. Here's some code, although students might not want or need it: Python source (public domain): http://www.inetarena.com/~pdx4d/ocn/python/farey.py Color-coded in HTML for readability (uses Win32 IDLE colors -- pre-written conversion modules do this work [4]): http://www.inetarena.com/~pdx4d/ocn/python/farey.html Kirby ======= Notes: [1] http://groups.yahoo.com/group/math-learn/message/521 [2] The Farey series links to what are called Ford circles, as discussed in 'The Book of Numbers' by Conway and Guy. My thanks to Pat Ballew for pointing this out: http://groups.yahoo.com/group/math-learn/message/523 [3] Domingo Gómez Morín generalizes the notion of mediant in his definition of rational mean, which he uses to specify various root-finding algorithms etc. Morín's site suggests some more fun programming challenges. See: http://www.etheron.net/usuarios/dgomez/RmDef.htm [4] (c) 1996-2000 by Mitchell S. Chapman, Zachary Roadhouse, Tim Peters and Just van Rossum (I modified the color key to match Win32 IDLE 0.8).
participants (3)
-
Jason Cunliffe
-
Kirby Urner
-
Lex Berezhny