Re: [Tutor] The Game of Life

2005-01-06 Thread Kent Johnson
Danny Yoo wrote: There seems to be a fashionable push to introduce patterns early on in computer science education, perhaps because they are easy to put in as test questions. But despite this, I do think that there are some patterns that are worth seeing, even if they are in unrealistic toy situati

Re: [Tutor] The Game of Life question

2005-01-05 Thread Danny Yoo
On Wed, 5 Jan 2005, Kooser, Ara S wrote: >They picked a project to model the flow of smallpox in a city and > surroundings areas. So I saw the game of life and thought maybe they > could modify it for use as a smallpox model. Hi Ara, Oh! My apologies for not posting the file as a comple

Re: [Tutor] The Game of Life

2005-01-05 Thread Danny Yoo
> > Just as a warning, none of what I'm going to code here is original at > > all: I'm rehashing a main idea off of a paper called "Using the Game > > of Life to Introduce Freshman Students to the Power and Elegance of > > Design Patterns": > > > > http://portal.acm.org/citation.cfm?id=103529

Re: [Tutor] The Game of Life question

2005-01-05 Thread Brian van den Broek
Kooser, Ara S said unto the world upon 2005-01-05 10:15: This is most likely a silly question and me not understanding python enough. I am a mentor for some high school kids participating in a supercomputing challenge. My background in programming is F77 (yeah laugh it up) and I want the kids to

Re: [Tutor] The Game of Life question

2005-01-05 Thread Kent Johnson
You need to include the line import random at the beginning of your program. This gives you access to the contents of the 'random' module such as random.choice(). This chapter of the tutorial talks about modules: http://docs.python.org/tut/node8.html Kent Kooser, Ara S wrote: This is most like

[Tutor] The Game of Life question

2005-01-05 Thread Kooser, Ara S
This is most likely a silly question and me not understanding python enough. I am a mentor for some high school kids participating in a supercomputing challenge. My background in programming is F77 (yeah laugh it up) and I want the kids to learn python and use it for the challenge. They pick

Re: [Tutor] The Game of Life

2005-01-03 Thread Kent Johnson
Danny Yoo wrote: (Aside: one nonobvious example where copying can be avoided is in Conway's Game of Life: when we calculate what cells live and die in the next generation, we can actually use the 'Command' design pattern to avoid making a temporary copy of the world. We can talk about this in mor

[Tutor] The Game of Life

2005-01-03 Thread Danny Yoo
On Mon, 3 Jan 2005, Brian van den Broek wrote: > >> (Aside: one nonobvious example where copying can be avoided is in > >> Conway's Game of Life: when we calculate what cells live and die in > >> the next generation, we can actually use the 'Command' design pattern > >> to avoid making a tempor