-> SK>Not really. I managed the program in a couple of hours. The logic
-> is SK>fairly simple. It's the details of input/output, correctly
-> counting SK>loops, etc.. that can mess you up (one of those looping
-> problems had me SK>going for a while).
-> Nested loops? What was this written in (pascal?)? Did
-> you set this up with a control program and call
-> subprograms/routines?
Well, my solution had a nested loop or two in it, but I solved the
problem a wee bit differently than the author of the workshop I
attended. I don't believe he used nested loops. I did write my solution
in Pascal, and I guess by "control program" you mean "main body" of my
program? Yes, it did call subroutines (called _procedures_ in Pascal).
Unless I'm writing an extremely short program, I usually always have
procedures in my programs. This is extremely common in Pascal, and since
that's the first language I learned...
-> SK>If you're interested in the specific rules, let me know. I'll look
-> them SK>up and post them here.
-> I think that would help me envision the task to a better
-> extent, thanks...
OK, here they are:
1. Every empty cell with three living neighbors wil come to life in the
next generation.
2. Any cell with one or zero neighbors wil die of loneliness, while any
cell with four or more neighbors will die from overcrowding.
3. Any cell with two or three neighbors will live into the next
generation.
4. All births and deaths occur simulatneously.
So, for example, imagine the grid we are playing on is 8x8 and a living
cell is denoted with X and an empty cell is denoted with 0. The starting
grid is given as follows:
X00X0X00
0000XX0X
X0X00X00
0XX0X000
00X00XXX
0X00X00X
00000000
X00000X0
Then the next generation would be this:
00000XX0
0XOXOX00
00X00XX0
00X0X000
00X0XXXX
00000X0X
00000000
00000000
Hope this helps!
Sheila
--- PCBoard (R) v15.22/M 10
---------------
* Origin: Castle of the Four Winds...subjective reality? (1:218/804)
|