Programmable computer

For discussion of specific patterns or specific families of patterns, both newly-discovered and well-known.
User avatar
gameoflifemaniac
Posts: 774
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Programmable computer

Post by gameoflifemaniac » January 29th, 2017, 2:55 pm

So the second prime printer calculates all primes up to 223?
https://www.youtube.com/watch?v=q6EoRBvdVPQ
One big dirty Oro. Yeeeeeeeeee...

User avatar
blah
Posts: 244
Joined: April 9th, 2016, 7:22 pm

Re: Programmable computer

Post by blah » January 29th, 2017, 3:25 pm

Okay. I Did It Myself. I installed python on my laptop and then moved the assembled files onto my PC. My program was actually incomplete, by the way; I forgot the print instruction. Technically it would still have simulated the CA (which is rule 102, by the way) but it wouldn't have displayed it. Here's the corrected version:

Code: Select all

write a 1
print a
add a a b
xor a b a
goto 1
Also, the assembler program has a few missing features. Namely labels and the ability to pre-set the contents of registers, rather than having to use write instructions at the beginning of the program. Maybe I'll make a Lua version myself with these features.

I would post the file, but apparently I can only post an attachment of up to 256 kilobytes. I compressed it and I got a filesize similar to what dvgrn posted (~650kb) but it's still too big for me to post.
succ

simeks
Posts: 369
Joined: March 11th, 2015, 12:03 pm
Location: Sweden

Re: Programmable computer

Post by simeks » January 29th, 2017, 3:59 pm

gameoflifemaniac wrote:So the second prime printer calculates all primes up to 223?
Yes, and after that it gets confused by arithmetic overflow and claims all odd numbers from 229 to 255 are prime numbers...
I use this C program to simulate the behaviour:

Code: Select all

#include <stdlib.h>
#include <stdio.h>

#define u8 unsigned char

int main (void)
{
		int ic = 0;
		
		u8 a = 0;
		u8 b = 0;
		u8 c = 0;
		u8 d = 0;
		u8 e = 0;
		u8 f = 0;
		u8 g = 0;
		
L00:	ic++; f = 224;
L01:	ic++; g = 2;
L02:	ic++; a = 5;
L03:	ic++; b = 3;
L04:	ic++; c = 0;
L05:	ic++; e = ~a;
L06:	ic++; e++;
L07:	ic++; d = b + e;
L08:	ic++; c++;
L09:	ic++; d = d + b;
L10:	ic++; e = d & f;
L11:	ic++; if (e != 0) goto L13;
L12:	ic++; goto L14;
L13:	ic++; goto L08;
L14:	ic++; if (d != 0) goto L16;
L15:	ic++; goto L24;
L16:	ic++; e = ~c;
L17:	ic++; e = b + e;
L18:	ic++; e = (e & 0x80 ? 0xff : 0x00);
L19:	ic++; if (e != 0) goto L21;
L20:	ic++; goto L23;
L21:	ic++; b = b + g;
L22:	ic++; goto L04;
L23:	ic++; printf ("%3d, ic = %5d\n", a, ic);
L24:	ic++; a = a + g;
				if (a < 5) return 0;
L25:	ic++; goto L03;

		return 0;
}

User avatar
gameoflifemaniac
Posts: 774
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Programmable computer

Post by gameoflifemaniac » January 30th, 2017, 8:40 am

So what's with 225 and 227?
https://www.youtube.com/watch?v=q6EoRBvdVPQ
One big dirty Oro. Yeeeeeeeeee...

User avatar
gameoflifemaniac
Posts: 774
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Programmable computer

Post by gameoflifemaniac » February 11th, 2017, 3:09 am

Your calculator calculated all the primes up to 199. It took our computer a week.
https://www.youtube.com/watch?v=q6EoRBvdVPQ
One big dirty Oro. Yeeeeeeeeee...

Coban
Posts: 12
Joined: June 26th, 2016, 3:50 pm
Location: France

Re: Programmable computer

Post by Coban » March 10th, 2017, 5:26 pm

Hi,
I made an english document that summarizes the functioning of my in-game computer:
https://drive.google.com/open?id=0B-4kR ... UJZWTlOMTg

Post Reply