Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 21:37 02 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2:Game of Life / upgrade

Author Message
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1133
Posted: 07:34pm 24 Aug 2020
Copy link to clipboard 
Print this post

Six years ago I wrote "The Game of Life" for Maximites.

This is the upgraded version of John Conway's GOL for the CMM2. Improvements: graphics, speed and menu for the demos. An editor is planned.

It is fast:
To complete a small world (1000 cells) it needs ~50ms.
A large world (4000 cells) takes ~190ms.





Life.zip

Any feedback appreciated.

Best regards
Michael

EDIT:
BTW: included is a array copy for integers (CSUB). It needs 12ms for an array of 100000 integers. Only useful for very lange arrays.

' CSUB Acopy takes 12ms for 100000 elements
' compared to Basic 860ms
' ******************************************

CONST E=100000
dim integer t(E)
dim integer s(E)
for i = 0 to E
t(i)=i
next

timer=0
for i = 0 to E:s(i)=t(i):next
PRINT timer "ms"

timer=0
acopy t(), s(), E
PRINT timer "ms"

end

'File acopy.bas written 20-08-2020 13:08:46
'acopy source(), dest(), elements
CSUB acopy integer, integer, integer
 00000000
 'acopy
 B087B480 60F8AF00 607A60B9 617B2300 697BE00E 68FA00DB 697A4413 68B900D2
 E9D34411 E9C12300 697B2300 617B3301 461A697B 73E2EA4F E9D16879 42900100
 0303EB71 BF00DAE5 371CBF00 F85D46BD 47707B04
End CSUB

Edited 2020-08-25 05:47 by twofingers
 
Sasquatch

Senior Member

Joined: 08/05/2020
Location: United States
Posts: 296
Posted: 08:29pm 24 Aug 2020
Copy link to clipboard 
Print this post

Looks Good!!!  And it is Fast!  There be Gliders and Guns!

You might want to set the graphics mode to 1,8 although the Small and Med playing fields also look nice in Mode 2,8
-Carl
 
qwerty823
Newbie

Joined: 30/07/2020
Location: United States
Posts: 30
Posted: 08:48pm 24 Aug 2020
Copy link to clipboard 
Print this post

  twofingers said  BTW: included is a array copy for integers (CSUB). It needs 12ms for an array of 100000 integers. Only useful for very lange arrays.


Have you seen:
MATH SCALE in(), scale ,out()

This scales the matrix in() by the scalar scale and puts the answer in out(). Works for arrays of any dimensionality of both integer and float and can convert between. Setting b to 1 is optimised and is the fastest way of copying an entire array.
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1133
Posted: 06:37pm 26 Aug 2020
Copy link to clipboard 
Print this post

Hi Carl,

thanks for checking. Actually, it's made for >Mode 1,8<. Must have been lost somehow ...


Hi qwerty823 and welcome!

  qwerty823 said  Have you seen:
MATH SCALE in(), scale ,out()

No! And you are totaly right! I replaced the ACopy() CSUB with that. It's insignificant slower.

Sometimes it is worth reading the manual ... Thank you!

____________________________

This ist the new version with an included editor. I think it's cool.




Life 202.zip

Included are some ".gol" files please rename to "LIFE.GOL"

Best regards
Michael
 
Sasquatch

Senior Member

Joined: 08/05/2020
Location: United States
Posts: 296
Posted: 02:14am 27 Aug 2020
Copy link to clipboard 
Print this post

looks like maybe you accidentally left a save image test in the load function?
-Carl
 
twofingers
Guru

Joined: 02/06/2014
Location: Germany
Posts: 1133
Posted: 11:27am 27 Aug 2020
Copy link to clipboard 
Print this post

  Sasquatch said  looks like maybe you accidentally left a save image test in the load function?

Hi Carl,

you are absolutely right again! Took a picture for the forum and forgot to remove the inserted code. It seems I'm too old for the Game of Life!
Thank you!

EDIT 27.09.2020:
The latest version has nine slots for storing GOL files, a single step mode, additional GOL files, an auto save mode, improved speed and more.
I included epsilons very useful MAR archive program (v0.3). Many thanks for that!  

EDIT 16.10.2020:
This is the new XL version. It is working with MMBasic >=V5.05.04 but especially for MMBasic V5.05.06 and later. With MMBasic V5.05.06 it is now very fast (8 times than the older version). I had to include a brake.


Livex 35.zip








Enjoy!
Edited 2020-10-16 22:34 by twofingers
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024