Game of Life sizecoding contest
Game of Life sizecoding contest
I was asked to code a GAME OF LIFE in 1K on the ZX81.
This made we do a search for GAME OF LIFE on the ZX Spectrum.
I didn't find a version on the ZX Spectrum so I was thinking
of a sizecoding contest for GAME OF LIFE on the ZX Spectrum
The rules for the sizecoding contest
1) The rules of GAME OF LIFE must be followed:
a) Any live cell with fewer than two live neighbours dies, as if by underpopulation.
b) Any live cell with two or three live neighbours lives on to the next generation.
c) Any live cell with more than three live neighbours dies, as if by overpopulation.
d) Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
2) The size of the code counts. If your code uses ROM-routines only the CALL to the routine counts
Example : CALL #DAF = 3 bytes for CLS RST 16 = 1 byte for print
3) All tricks are allowed, like using the value of BC after the USR-command that holds the startaddress,
decompressing code etc...
4) The program must have some kind of editor to set/reset colonies.
5) After starting the game the game keeps running until a key is pressed to stop.
6) (symbol) shift can be skipped as a valid keypress to stop the game.
7) After stopping the game you return to the editor.
8) There is a keycombination to stop the game and clear the screen.
9) There is a keycombination to stop the game and NOT clear the screen.
10) The screen is at least 32x24 in size.
11) The screen goes around on same line/colom. A glider will keep moving and reappear on the opposite site
of the screen it went out.
12) Deadline is 2nd Easter 23:59 CET.
13) Sent your game (source and TAP/Z80) to [email protected]
14) DO NOT TELL OTHERS THE SIZE OF YOUR CODE!
15) You can always update your game when you made it shorter.
16) After the contest all contesters are mentioned in a rankinglist
17) All games will be published too.
This made we do a search for GAME OF LIFE on the ZX Spectrum.
I didn't find a version on the ZX Spectrum so I was thinking
of a sizecoding contest for GAME OF LIFE on the ZX Spectrum
The rules for the sizecoding contest
1) The rules of GAME OF LIFE must be followed:
a) Any live cell with fewer than two live neighbours dies, as if by underpopulation.
b) Any live cell with two or three live neighbours lives on to the next generation.
c) Any live cell with more than three live neighbours dies, as if by overpopulation.
d) Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
2) The size of the code counts. If your code uses ROM-routines only the CALL to the routine counts
Example : CALL #DAF = 3 bytes for CLS RST 16 = 1 byte for print
3) All tricks are allowed, like using the value of BC after the USR-command that holds the startaddress,
decompressing code etc...
4) The program must have some kind of editor to set/reset colonies.
5) After starting the game the game keeps running until a key is pressed to stop.
6) (symbol) shift can be skipped as a valid keypress to stop the game.
7) After stopping the game you return to the editor.
8) There is a keycombination to stop the game and clear the screen.
9) There is a keycombination to stop the game and NOT clear the screen.
10) The screen is at least 32x24 in size.
11) The screen goes around on same line/colom. A glider will keep moving and reappear on the opposite site
of the screen it went out.
12) Deadline is 2nd Easter 23:59 CET.
13) Sent your game (source and TAP/Z80) to [email protected]
14) DO NOT TELL OTHERS THE SIZE OF YOUR CODE!
15) You can always update your game when you made it shorter.
16) After the contest all contesters are mentioned in a rankinglist
17) All games will be published too.
Re: Game of Life sizecoding contest
I made a version for the spectrum a long time ago, but I lost it!
It was in basic and used attributes - it was pretty slow. Could be a fun challenge.
It was in basic and used attributes - it was pretty slow. Could be a fun challenge.
Re: Game of Life sizecoding contest
While they will not be winning a size competition, Rosetta Code has versions of both in basic:
And also a Z80 version for the MSX.
Re: Game of Life sizecoding contest
I guess everybody is going for 32x24 attribute based version ? Ok, could be fun.
Proud owner of Didaktik M
Re: Game of Life sizecoding contest
why don't make the context slightly more… fun? harder? you-name-the-word ;-) by requiring field of at least 64x48? it will require slightly more efforts, but i believe that it also allows for more tricks to be used, and it also will be twice as fun to watch too! ;-)
or, to make the thing accessible for everybody, judge solutions with different fields sizes separately, each in its own category.
or, to make the thing accessible for everybody, judge solutions with different fields sizes separately, each in its own category.
- ParadigmShifter
- Manic Miner
- Posts: 765
- Joined: Sat Sep 09, 2023 4:55 am
Re: Game of Life sizecoding contest
Michael Abrash (software rendering optimisation (ASM) on Quake) held a compo where the emphasis was on speed so this postmortem may give some ideas
https://www.phatcode.net/res/224/files/ ... 17-01.html
There should probably be a category for speed as well (number of generations/second) since that's probably of more practical use than reducing the size?
I'd probably do a variant on the lookup table technique outlined in that article (and following ones) but with 2 cells per entry in the table instead of the 3 the winning entry used (so that had to use a 64K lookup table). Obviously the table would have to be generated via code (running from the buffer where the celldata will be stored) to reduce code size.
Probably won't enter myself though
https://www.phatcode.net/res/224/files/ ... 17-01.html
There should probably be a category for speed as well (number of generations/second) since that's probably of more practical use than reducing the size?
I'd probably do a variant on the lookup table technique outlined in that article (and following ones) but with 2 cells per entry in the table instead of the 3 the winning entry used (so that had to use a 64K lookup table). Obviously the table would have to be generated via code (running from the buffer where the celldata will be stored) to reduce code size.
Probably won't enter myself though
Re: Game of Life sizecoding contest
BTW Easter 2nd is also 1st of april, I just looked up but it is not a joke.
Additional rule:
Machinecode counts, but no presetting in BASIC like PAPER , INK etc.
Only LOAD "" CODE and then
RANDOMIZE USR
PRINT USR
GOTO USR
whatever you like to start
(free tip: RUN USR clears the screen)
Additional rule:
Machinecode counts, but no presetting in BASIC like PAPER , INK etc.
Only LOAD "" CODE and then
RANDOMIZE USR
PRINT USR
GOTO USR
whatever you like to start
(free tip: RUN USR clears the screen)
Re: Game of Life sizecoding contest
ketmar wrote: ↑Tue Dec 05, 2023 12:43 am why don't make the context slightly more… fun? harder? you-name-the-word by requiring field of at least 64x48? it will require slightly more efforts, but i believe that it also allows for more tricks to be used, and it also will be twice as fun to watch too!
or, to make the thing accessible for everybody, judge solutions with different fields sizes separately, each in its own category.
Rules state at least, but adding own competition for other sized solutions is now added.
Re: Game of Life sizecoding contest
Re: Game of Life sizecoding contest
There's loads in the archive btw, titled "Life" rather than "Game of Life". E.g. this one.
But that doesn't change anything with this competition - it sounds a fun challenge.
Re: Game of Life sizecoding contest
I did a search on GAME OF LIFE.
Thanks.
Still the contest stays open.
Re: Game of Life sizecoding contest
There was a colour version included on another game - I seem to think it was a Pete Cooke game.
Re: Game of Life sizecoding contest
Quick question, when starting the game do you need have a preset pattern or can it load straight into an editor so you can create a pattern?Dr beep wrote: ↑Mon Dec 04, 2023 10:30 pm I was asked to code a GAME OF LIFE in 1K on the ZX81.
This made we do a search for GAME OF LIFE on the ZX Spectrum.
I didn't find a version on the ZX Spectrum so I was thinking
of a sizecoding contest for GAME OF LIFE on the ZX Spectrum
The rules for the sizecoding contest
1) The rules of GAME OF LIFE must be followed:
a) Any live cell with fewer than two live neighbours dies, as if by underpopulation.
b) Any live cell with two or three live neighbours lives on to the next generation.
c) Any live cell with more than three live neighbours dies, as if by overpopulation.
d) Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
2) The size of the code counts. If your code uses ROM-routines only the CALL to the routine counts
Example : CALL #DAF = 3 bytes for CLS RST 16 = 1 byte for print
3) All tricks are allowed, like using the value of BC after the USR-command that holds the startaddress,
decompressing code etc...
4) The program must have some kind of editor to set/reset colonies.
5) After starting the game the game keeps running until a key is pressed to stop.
6) (symbol) shift can be skipped as a valid keypress to stop the game.
7) After stopping the game you return to the editor.
8) There is a keycombination to stop the game and clear the screen.
9) There is a keycombination to stop the game and NOT clear the screen.
10) The screen is at least 32x24 in size.
11) The screen goes around on same line/colom. A glider will keep moving and reappear on the opposite site
of the screen it went out.
12) Deadline is 2nd Easter 23:59 CET.
13) Sent your game (source and TAP/Z80) to [email protected]
14) DO NOT TELL OTHERS THE SIZE OF YOUR CODE!
15) You can always update your game when you made it shorter.
16) After the contest all contesters are mentioned in a rankinglist
17) All games will be published too.
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Re: Game of Life sizecoding contest
You can even start with an empty screen running if that is shorter code.
There is no rule for a startpattern nor a start in the editor.
There is no rule for a startpattern nor a start in the editor.
Re: Game of Life sizecoding contest
This was basically my exposure to 'Game of Life' as a kid. Even after the Horizons tape surfaced.
I found it confusing because I'm sure the concept appeared multiple times in Speccy programs (e.g. BASIC type-ins) - people used to talk about it like it was something that everyone would've heard of, but I hadn't a clue what it was. Did they used to teach this sort of thing in school in the 60s or something?
My Speccy site: thirdharmoniser.com
Re: Game of Life sizecoding contest
It's a geek/programmer thing, which I think would come up as college assignments and the like. It's an open-ended project with as many possible implementations as there are programmers ( this was before they were called engineers ), so popular with a certain set. See also Tower of Hanoi.
Re: Game of Life sizecoding contest
Just sent my first entry, hopefully figured out the rules ok
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com
Re: Game of Life sizecoding contest
I will try to take a look. I am on a roadtrip to Ireland but this evening I have some time on the ferry to check mail.
Re: Game of Life sizecoding contest
Have you thought about making a website or blog or something where we can see/test/play the participants?
Re: Game of Life sizecoding contest
I don't know if you already have had a look to this:
https://spectrumcomputing.co.uk/entry/2 ... Macro-Life
https://spectrumcomputing.co.uk/entry/2 ... Macro-Life
If something works, don't touch it !!!! at all !!!
- Einar Saukas
- Bugaboo
- Posts: 3169
- Joined: Wed Nov 15, 2017 2:48 pm
Re: Game of Life sizecoding contest
This program perfectly implements all Game of Life rules when starting with an empty screen:
Code: Select all
10 CLS: PAUSE 0
Re: Game of Life sizecoding contest
My current attempt running...
Retro enthusiast and author of Flynn's Adventure in Bombland, The Order of Mazes & Maze Death Rally-X. Check them out at http://tomdalby.com