Conway's Game of Life
Author |
Message |
Wakening
|
Posted: Sun Apr 15, 2012 9:40 am Post subject: Conway's Game of Life |
|
|
What is it you are trying to achieve?
Creating an efficient simulation of Conway's Game of Life
What is the problem you are having?
The process which decides the next generation is far too inefficient and requires too much cpu
Describe what you have tried to solve this problem
Changing the drawing/displaying procedure and integrating it into the next gen. cycle procedure
Changing array types to boolean instead of integer
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
See attached File
Please specify what version of Turing you are using
4.1
Any help would be greatly appreciated.
Description: |
I'd like to increase the total size of the arena far more, but it's too taxing on my computer. |
|
Download |
Filename: |
v1.3 Conway's Game of Life.t |
Filesize: |
3.19 KB |
Downloaded: |
79 Time(s) |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Wakening
|
|
|
|
|
Raknarg
|
Posted: Sun Apr 15, 2012 2:37 pm Post subject: Re: Conway's Game of Life |
|
|
It seems to work fine for me. However, you can look at the one that zylum made a while back that I saved:
Description: |
|
Download |
Filename: |
Game of Life.t |
Filesize: |
2.19 KB |
Downloaded: |
71 Time(s) |
|
|
|
|
|
|
Raknarg
|
Posted: Sun Apr 15, 2012 2:41 pm Post subject: RE:Conway\'s Game of Life |
|
|
actually, I did chage one thing just to make myself happier:
Turing: |
procedure Cycle
for ix : 2 .. totalx - 1
for iy : 2 .. totaly - 1
if arena (ix, iy ) = true then
drawfillbox (ix * 5, iy * 5, ix * 5 + 4, iy * 5 + 4, black)
if EdgeCount (ix, iy ) < 2 then
temparena (ix, iy ) := false
elsif EdgeCount (ix, iy ) > 3 then
temparena (ix, iy ) := false
end if
elsif arena (ix, iy ) = false then
if EdgeCount (ix, iy ) = 3 then
temparena (ix, iy ) := true
end if
end if
end for
end for
for ix : 2 .. totalx - 1
for iy : 2 .. totaly - 1
arena (ix, iy ) := temparena (ix, iy )
end for
end for
View.Update
cls
end Cycle
|
I think it makes more sense only to draw where the points are alive and then just wipe it after.
|
|
|
|
|
|
|
|