1 REM WOLFRAM CELL AUTOMATON
2 REM BY ARM_CODER 2025
10 CW = 50 : HG = 20
20 PRINT "RULE NUMBER (0-255): ";
30 INPUT RN
100 DIM CL(CW)
110 DIM NC(CW)
120 FOR I = 1 TO CW : CL(I) = 0: NC(I) = 0: NEXT I
130 CL(CW/2+1) = 1
140 DIM RU(8) : MS = 1
150 FOR I = 1 TO 8 
160 RU(I) = 0 : IF (RN AND MS) > 0 THEN RU(I) = 1
170 MS = MS * 2
180 NEXT I
190 PRINT "."; : FOR I = 1 TO CW : PRINT "="; : NEXT I : PRINT "."
200 FOR H = 1 TO HG
210 PRINT ".";
215 FOR I = 1 TO CW
216 IF (CL(I) > 0) THEN PRINT "#"; : GOTO 220
217 PRINT " "; 
220 NEXT I
230 PRINT "."
240 FOR I = 1 TO CW
250 IL = I-1 : IF IL < 1 THEN IL = CW
260 IR = I+1 : IF IR > CW THEN IR = 1
270 IX = 4 * CL(IL) + 2 * CL(I) + CL(IR) : NC(I) = RU(1+IX)
280 NEXT I
290 FOR I = 1 TO CW : CL(I) = NC(I) : NEXT I
300 NEXT H
310 PRINT "."; 
320 FOR I = 1 TO CW : PRINT "="; : NEXT I
330 PRINT "."
340 END

