Conway’s game of life


Author Message
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1619
Posted: 12:17am 27 Apr 2020      

Hi Tom,

Yes, your code is faster on the Micromite. With the Micromite using both b$ and b is a no no, so I changed b$ to e$.

  Quote  Actually you would only need a 1D array of strings, an element per line. But I don't believe this will help you because of all the additional variable lookups at the printing stage. Now if there were a PRINT (C)function that could print the entire array as a single operation it would be different. Note that printing a line at a time did not make as significant a performance improvement as I expected, and a great deal less than the variable lookup optimisation

Yes, a 1D array of course. I was thinking of the visual appearance (?) hoping to reduce the delay between each line. I'll try it and see.

Re the grapics, Maximite can use custom fonts, I haven't investigated them yet but maybe a font could be used in place of grapics.

  Quote  On most computers integer operations are faster than floating point operations

I believe that on the 'Mites that integers can even be slower because floating point calculations use the on-board floating point processor. I deliberately didn't use integers because I was aiming for a Maximite version.

  Quote  However if you declare a single matrix with twice the number of rows you can then just switch between the two "halves" using offsets into that matrix,

That's a good idea to reduce the code size, it did annoy me to have to have two almost identical subroutines. However it was quicker than the method used in the DOS version.

  Quote  You could try making the matrix toroidal by having the right hand side consider cells on the left hand side to be adjacent, and vice-versa. Same for top and bottom. You'll lose some performance but it makes smaller matrices more interesting; I will be doing it for my 16x16 LED matrix.

Whoosh! that went straight over my head. Coffee won't help with that one.

Thanks again

Bill
Edited 2020-04-27 10:19 by Turbo46
Keep safe. Live long and prosper.