Page 1 of 1

Challenge 1: Rule 110 implemtations

Posted: Thu Dec 18, 2025 5:59 am
by Jeff Calc 84
Rule 110 is a cellular automaton that has been proved to be turing complete.
Today's challenge is to implement Rule 110.
Here are the languages you can use:
Ordinary: C/C++, Python, Ti-Basic, Axe
Just weird: Befunge, Brainf***, FALSE, <><

Plz PM me your answers. (I'll check next Monday ;) )

LAST TIME FOR SUBMISSION: UTC 12:00 PM 12/21

Re: Challenge 1: Rule 110 implemtations

Posted: Thu Dec 18, 2025 6:00 am
by Jeff Calc 84
Ahem, one more rule: NO COPYING OTHER PEOPLE'S CODE.

Re: Challenge 1: Rule 110 implemtations

Posted: Fri Dec 19, 2025 12:28 pm
by Sumde
You should make a scoreboard of the points! :D

Re: Challenge 1: Rule 110 implemtations

Posted: Sat Dec 20, 2025 3:36 am
by Jeff Calc 84
yep.

Re: Challenge 1: Rule 110 implemtations

Posted: Sun Dec 21, 2025 8:30 am
by Jeff Calc 84
I guess it's over now.
SCOREBOARD:
A. Computer
1. Sumde, for their impressive C code *made in 15 minutes*:

Code: Select all

#include <stdio.h>

#define HEIGHT 80
#define WIDTH 80

int main() {
	int automation_contents[HEIGHT][WIDTH]= {0};
	automation_contents[0][WIDTH-2] = 1;

	int next_gen[WIDTH] = {0};
	int test[8] = {0,1,1,1,0,1,1,0};
	for (int i = 0; i<HEIGHT; i++) {
		for (int j = 0; j<WIDTH-2; j++) {
			int ac_offset[3];
			for (int k = 0; k<3; k++) {
				ac_offset[k] = automation_contents[i][j+k];
			}
			next_gen[j+1]=test[4*ac_offset[0]+2*ac_offset[1]+ac_offset[2]];
			if (i!=HEIGHT-1) {
				automation_contents[i+1][j+1] = next_gen[j+1];
			}
		}
		for (int j = 0; j<WIDTH; j++) {
			if (automation_contents[i][j]==1) {
				printf("#");
			}
			if (automation_contents[i][j]==0) {
				printf(".");
			}
		}
		printf("\n");
	}
	return 0;
}
B. Calculator
1. Jeff Calc 84, for some Axe code that runs slower (it's on a calc), but is still very speedy:

Code: Select all

.RULE110
ClrDraw
DiagnosticOff
Full
Pxl-On(94,0
1->B
0->{L1}
1->{L1+1}
1->{L1+2}
1->{L1+3}
0->{L1+4}
1->{L1+5}
1->{L1+6}
0->{L1+7}

Repeat getKey(15) or (B=70):DispGraph
   For(A,1,94
      4*pxl-Test(A-1,B-1)+(2*pxl-Test(A,B-1))+pxl-Test(A+1,B-1)->C
      If {L1+C}
         Pxl-On(A,B
      End
   End
   B++
   Pause 50
End
Pause 10000
In this contest, I've split it into two competitions, namely Computer and Calculator. Both Sumde and Jeff Calc 84 are winners!
:D :D :D

Stay tuned for next contest!