Ok so it turns out that the using CALL in a batch script is very slow. IF %%h EQU %height% (FOR /L %%w IN (1, 1, %width%) DO (SET BOT=~!BOT!))ĮCHO 'Conway's Game of Life' - Batch Edition - Chazjn ĮCHO =ĮCHO For more infomation visit: 's_Game_of_Life :: THIS FUNCTION DISPLAYS GRID 'A' ON SCREEN :: THE COUNT IS STORED IN VARIABLE 'NCOUNT' :: THIS FUNCTION COUNTS THE NUMBER OF NEIGHBOURS FOR THE GIVEN X AND Y CO-ORDINATES SET loop back to the top of process to start again SET Now check if we have any Grid 'B' cells :: - If required assign new alive/dead status in Grid 'B' :: Also for safety, delete any Grid 'B' cells that might be in memory I think the slowest part is the function GETNCOUNT - this gets the count of the neighbouring 'live' cells so it is called once per cell. However - it is slow, very slow on a large grid. I like writing in batch - its restrictions and limits are its appeal. Just for fun I have written a Conway's Game of Life in cmd batch file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |