[stdlib-sig] A game in the standard library

Ned Deily nad at acm.org
Thu Aug 16 21:08:59 CEST 2012


In article 
<CAP1=2W5h9QUKvNJjrw-bez-N92rpxxCp5qNO=oL6Wko90oPFAQ at mail.gmail.com>,
 Brett Cannon <brett at python.org> wrote:
> On Thu, Aug 16, 2012 at 7:38 AM, Yuval Greenfield 
> <ubershmekel at gmail.com>wrote:
> > What do you guys think about including a very simple game with the
> > standard library?
> So this is the kind of thing that would lead to arguments about "what
> game?" The general concept works for me, though if something can be agreed
> upon.
> 
> 
> > My very first lines of code were modifications to a QBasic game called
> > "nibbles" which came with QBasic. A memory dear to my heart and CV. The
> > world has changed and nowadays it's much easier to download whatever,
> > though I think this would still be useful for our younger downloaders:
> >
> > * As a reason to poke and tinker around c:\python33\Lib\ or
> > /usr/lib/python3.3/
> > * To give a simple, sample Tk app.
> >
> 
> That does screw over OS X users since their version of Tk by default is
> crap unless you also provide a non-GUI version.

> > * "import turtle" is nice but at 4K lines, we can do simpler. Also, as a
> > game it's mainly interesting for a very young demographic I believe.
> > * A simple, fun, readable, moddable, Tk game is possible at 200-400 lines
> > or about 10KB of uncompressed code.
> > * As another neat "Python is fun" example, a la "import antigravity"

Not that there shouldn't be more but what about python3 -m turtledemo ?   
That gives easy access to the source to a number of game-like demos in a 
simple and elegant interface.  (And it works fine on OS X with that 
"crap" Tk, using ActiveTcl.)

http://docs.python.org/py3k/library/turtle.html#demo-scripts

-- 
 Ned Deily,
 nad at acm.org



More information about the stdlib-sig mailing list