pouët.net

Go to bottom
This is the (one dimensional) Life!
screenshot added by orac81 on 2025-05-07 00:27:59
platform :
type :
release date : may 2025
  • 1
  • 1
  • 0
popularity : 45%
 45%
  • 0.50
alltime top: #79767
added on the 2025-05-07 00:27:59 by orac81 orac81

popularity helper

increase the popularity of this prod by spreading this URL:

or via: facebook twitter pinterest tumblr bluesky threads

comments

This is a version of the classic 1D Cellular Automata pattern generator, for 8086 DOS/VGA, in just 71 Bytes!
This is an old-school (and well known) effect, but it uses a different approach to most other programs I have seen, in particular I think using MOD 5 generates interesting graphics.


When running, hit SPACE for next pattern, ESC to quit. (CLR or MODE 80 after)
See file "life1d.txt" for more details.

There is an SDL2/linux version in the zip file too. See "sdl_life" folder and "sdl_life1d.txt" for details.

BB Image

There is a Turbo-C "TINYTC" version of the code (180 bytes) in the TC folder, and my original 1992 shareware version, which actually has a CGA option.
Also a load of pix in the "screenshot" folder.

I expect someone here will tell me it can be done in 32 bytes!
added on the 2025-05-07 00:33:03 by orac81 orac81
Here is the Turbo-C version using the "TCTINY" library.. (180 bytes)

Code: /* CLIFE1D.C - Classic 1D Cellular Automata Generator. (C) A.Millett 1992-2025. Released as free software under GNU GPL3 license. (See: www.gnu.org/licenses/gpl-3.0.html ) Simplified one Dimensional Cellular Automata pattern Generator, for DOS. Hit SPACE for next pattern, ESC to quit. (type CLS or MODE 80 after) Uses MOD 5 sum of 3 cells above for next gen. For DOS/VGA, minimal version written in <256 bytes for TurboC + TCTINY lib. To build: TCTINY [TC3PATH] XLIFE2Dx to build tiny .COM file (<1k) (See TCTINY.TXT for details on using TCTINY library) Code from LIFE17.C, XLIFE2D4.C .. ->CLIFE1D-104 (6.5.2025) Make smaller/faster, sim to NASM version. ->CLIFE1D-105 (6.5.2025) (180 bytes) */ typedef unsigned char BYTE; typedef unsigned int UINT; #include "tctiny.c" BYTE far *pTop = (BYTE far *) ((unsigned long) 0xa0000000L); /* Vdu top, also used as "Rules" array */ #define XMOD 5 void main () { register BYTE far *pVdu; UINT x; UINT rnd = 0xa000; /* Set VGA video mode 13h 320x200x256 */ IO_VIDEOMODE (0x13); do { /* Top line is a "rules" lookup table for rest of screen */ for (x = 0; x < 319; x ++) { rnd += x; rnd += rnd + (rnd >> 15); rnd ^= (rnd >> 8); pTop [x] = rnd; } /* Draw main screen, each new cell based on state of 3 above. */ pVdu = pTop; do { pVdu [321] = pTop[(*pVdu+pVdu[1]+pVdu[2]) % XMOD] ; pVdu ++; } while ((UINT) pVdu); /* Ok, check for user key hit */ do { IO_GETKEY (x); } while (x == 0); } while (x != 27); /* IO_VIDEOMODE (3); */ }


And another screenshot..

BB Image
added on the 2025-05-07 00:45:21 by orac81 orac81
You called it and here it is ;)
Rudi did something in 128 then in 64 bytes, then i optimized it to 55 bytes and created something similar in 24 bytes

Totalistic & Edits

Tough to compare all those 1D automatons, but yes, 32 bytes for a decent one should be enough ;)
rulez added on the 2025-05-07 16:31:52 by HellMood HellMood
yes, inevitable! This one does compile down to 57b if using mod 4 and no user keys, but the results are less interesting. I thought it important that the user could step through a wide range of different effects.

After writing it I realized I had done it differently from the normal 1d method, in fact the 5 colours are 0-255 vga index, which are added and THEN made MOD 5. This makes the colours more varied, and I think changes the maths and makes the effects more interesting.
More experiments needed.

Thanks for the links, useful..
added on the 2025-05-09 14:32:45 by orac81 orac81

submit changes

if this prod is a fake, some info is false or the download link is broken,

do not post about it in the comments, it will get lost.

instead, click here !

[previous edits]

add a comment

Go to top