[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [pygame] Life with PyGame
------------------------------------
>c:\python21\pythonw -u pygalife.py
*** Press [Ctrl-C] to exit. ***
Traceback (most recent call last):
File "pygalife.py", line 123, in ?
main()
File "pygalife.py", line 112, in main
white = 2 ** screen.get_bitsize() - 1
OverflowError: integer exponentiation
----------------------------------------
mike
-----Original Message-----
From: owner-pygame-users@seul.org [mailto:owner-pygame-users@seul.org]On
Behalf Of Nicola Larosa
Sent: Monday, February 18, 2002 11:17 AM
To: pygame-users@seul.org
Subject: [pygame] Life with PyGame
Hi, been lurking 'til now.
Got something to show you. After installing Numeric Python I noticed a nice
optimized implementation of Conway's Game of Life, the one about cellular
automata. It displays characters on the console, and I thought it would be
neat to use PyGame, so I stole some code from arraydemo.py and produced the
attached file.
It doubles the image dimension to make the dots more visible, and starts
with a random configuration. I did not get quite right the computation of
the color of the dots, they come out green on 8 bit depth, white on 16 bit,
and yellow on 24 bit. :^)
Any comments welcome, obviously. Enjoy.
--
"I was wondering if there's any kind of definitive nickname for Perl
programmers, the way we call ourselves Pythonistas?" - Aahz Maruch
"Masochists." - Daniel Klein
Nicola Larosa - nico@tekNico.net
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org