Skip to content

Instantly share code, notes, and snippets.

@vampjaz
Created May 22, 2016 16:05
Show Gist options
  • Save vampjaz/b265c6b5c4f2909629a8fcb5e9c20977 to your computer and use it in GitHub Desktop.
Save vampjaz/b265c6b5c4f2909629a8fcb5e9c20977 to your computer and use it in GitHub Desktop.
Thue solutions - lines starting with a space are comments
ab=ba;
that was easy
r0=0ar;
r1=1ar;
0r=0;
1r=1;
pk=k;
0a=a0;
1a=a1;
aaaa=pppp;
aaa=ppp;
aa=pp;
a=p;
0p00=00p0;
0p01=01p0;
0p10=00p1;
0p11=01p1;
1p00=10p0;
1p01=11p0;
1p10=10p1;
1p11=11p1;
p00=z0p0;
p01=z1p0;
p10=z0p1;
p11=z1p1;
p1=k1;
p0=k0;
z1=1;
z0=0;
k0=0;
k1=1;
$=Az;
0A=B;
1A=B.;
0B=C;
1B=C..;
0C=D;
1C=D....;
0D=E;
1D=E........;
0E=F;
1E=F,......;
0F=G;
1F=G,,,..;
0G=H;
1G=H,,,,,,....;
0H=I;
1H=I:,,........;
0I=;
1I=::,,,,,......;
A=;
B=;
C=;
D=;
E=;
F=;
G=;
H=;
I=;
z=[{(;
.,=,.;
,:=:,;
..........=,;
,,,,,,,,,,=:;
.[=[.;
,[=[,;
.{={.;
{(={0;
[{=[0;
#[=#0;
[=;
{=;
(=;
#0=#;
.........=9;
........=8;
.......=7;
......=6;
.....=5;
....=4;
...=3;
..=2;
.=1;
,,,,,,,,,=9;
,,,,,,,,=8;
,,,,,,,=7;
,,,,,,=6;
,,,,,=5;
,,,,=4;
,,,=3;
,,=2;
,=1;
:::::::::=9;
::::::::=8;
:::::::=7;
::::::=6;
:::::=5;
::::=4;
:::=3;
::=2;
:=1;
#=;
sBX=hello;
p=sP;
P1=1P;
P2=2P;
P3=3P;
P4=4P;
P5=5P;
P6=6P;
P7=7P;
P8=8P;
P9=9P;
P0=0P;
P=Az;
convert to dots
0A=B;
1A=B.;
2A=B..;
3A=B...;
4A=B....;
5A=B.....;
6A=B......;
7A=B.......;
8A=B........;
9A=B.........;
0B=C;
1B=C,;
2B=C,,;
3B=C,,,;
4B=C,,,,;
5B=C,,,,,;
6B=C,,,,,,;
7B=C,,,,,,,;
8B=C,,,,,,,,;
9B=C,,,,,,,,,;
0C=;
1C=-;
2C=--;
3C=---;
4C=----;
5C=-----;
6C=------;
7C=-------;
8C=--------;
9C=---------;
dots to unary
-=,,,,,,,,,,;
,=..........;
dj=j;
division area
z=X$$ZY%%k;
duplicate dividend
>>>>>>>>>>>>|=|>>>>>>>>>>>>;
>>>>|=|>>>>;
>|=|>;
>Z=Z>;
|EY=#FY;
duplicate the divisor
____________<=<____________;
____<=<____;
_<=<_;
Y<=<Y;
____________(=(____________;
____(=(____;
_(=(_;
Y(=(Y;
k=j;
annihilate the things (division)
><=;
>(=;
Z(=:E~;
if we run out of divisor and we still have dividend, duplicate it again
>Y=>*Yd;
d_=<_d;
*=;
i need to make it so the first time the divisor is sent over, it is a different character,
and so when that char hits Z it marks it as prime because it's dividing by 1 + dividend
(but it would be better not to loop until that point)
or i could duplicate the dividend, and anihilate one of the duplicates for every two of the unary items in
the dividend, and then if there are any left over, it would reset and increment.
i'd just have to make sure to save the divisor first
increment the number to be checked
|ZY=@$$ZY;
|@=@$;
X@=X;
]_=];
]j=%%j;
)_=%);
)j=j;
used for incrementing
|#D=#||>>D;
|#=#|>;
X#=X;
have to make sure these duplicate after other things
%=<_;
$=|>;
decrement counter
|:=:|;
.X:=X;
~=;
reset the number to divide by and increment the tested number if we encounter a composite number
ZY=#DY];
>D=Z>*;
if it isn't divisible, increment divisor
Z<=|E};
}<=};
}Y=Y%);
F=Z;
this can only add integers
any integer though
it uses simple add-and-carry logic
0p=p0;
1p=p1;
2p=p2;
3p=p3;
4p=p4;
5p=p5;
6p=p6;
7p=p7;
8p=p8;
9p=p9;
q0=0q;
q1=1q;
q2=2q;
q3=3q;
q4=4q;
q5=5q;
q6=6q;
q7=7q;
q8=8q;
q9=9q;
q=tc;
00t=0t0;
01t=1t0;
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F;
33u=0vG;
34u=0vH;
35u=0vI;
36u=0vJ;
37u=1vA;
38u=1vB;
39u=1vC;
40u=0vE;
41u=0vF;
42u=0vG;
43u=0vH;
44u=0vI;
45u=0vJ;
46u=1vA;
47u=1vB;
48u=1vC;
49u=1vD;
50u=0vF;
51u=0vG;
52u=0vH;
53u=0vI;
54u=0vJ;
55u=1vA;
56u=1vB;
57u=1vC;
58u=1vD;
59u=1vE;
60u=0vG;
61u=0vH;
62u=0vI;
63u=0vJ;
64u=1vA;
65u=1vB;
66u=1vC;
67u=1vD;
68u=1vE;
69u=1vF;
70u=0vH;
71u=0vI;
72u=0vJ;
73u=1vA;
74u=1vB;
75u=1vC;
76u=1vD;
77u=1vE;
78u=1vF;
79u=1vG;
80u=0vI;
81u=0vJ;
82u=1vA;
83u=1vB;
84u=1vC;
85u=1vD;
86u=1vE;
87u=1vF;
88u=1vG;
89u=1vH;
90u=0vJ;
91u=1vA;
92u=1vB;
93u=1vC;
94u=1vD;
95u=1vE;
96u=1vF;
97u=1vG;
98u=1vH;
99u=1vI;
00v=0v0;
01v=0v1;
02v=0v2;
03v=0v3;
04v=0v4;
05v=0v5;
06v=0v6;
07v=0v7;
08v=0v8;
09v=0v9;
10v=0v1;
11v=0v2;
12v=0v3;
13v=0v4;
14v=0v5;
15v=0v6;
16v=0v7;
17v=0v8;
18v=0v9;
19v=1v0;
20v=0v2;
21v=0v3;
22v=0v4;
23v=0v5;
24v=0v6;
25v=0v7;
26v=0v8;
27v=0v9;
28v=1v0;
29v=1v1;
30v=0v3;
31v=0v4;
32v=0v5;
33v=0v6;
34v=0v7;
35v=0v8;
36v=0v9;
37v=1v0;
38v=1v1;
39v=1v2;
40v=0v4;
41v=0v5;
42v=0v6;
43v=0v7;
44v=0v8;
45v=0v9;
46v=1v0;
47v=1v1;
48v=1v2;
49v=1v3;
50v=0v5;
51v=0v6;
52v=0v7;
53v=0v8;
54v=0v9;
55v=1v0;
56v=1v1;
57v=1v2;
58v=1v3;
59v=1v4;
60v=0v6;
61v=0v7;
62v=0v8;
63v=0v9;
64v=1v0;
65v=1v1;
66v=1v2;
67v=1v3;
68v=1v4;
69v=1v5;
70v=0v7;
71v=0v8;
72v=0v9;
73v=1v0;
74v=1v1;
75v=1v2;
76v=1v3;
77v=1v4;
78v=1v5;
79v=1v6;
80v=0v8;
81v=0v9;
82v=1v0;
83v=1v1;
84v=1v2;
85v=1v3;
86v=1v4;
87v=1v5;
88v=1v6;
89v=1v7;
90v=0v9;
91v=1v0;
92v=1v1;
93v=1v2;
94v=1v3;
95v=1v4;
96v=1v5;
97v=1v6;
98v=1v7;
99v=1v8;
p0v=p;
p1v=p1;
ac=k;
c=tc;
A=0;
B=1;
C=2;
D=3;
E=4;
F=5;
G=6;
H=7;
I=8;
J=9;
u=_;
p=;
ak=;
k=;
_=;
+=paq;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment