kolibrios-fun/programs/demos/life2/lif/ADDER.lif

838 lines
8.5 KiB
Plaintext
Raw Normal View History

#Life 1.05
#D Binary Adder
#D By David Buckingham, with size optimization by Mark
#D Niemec, 1975. Two glider streams enter the lower
#D right, representing the binary numbers 1110 and 0011.
#D The sum, 10001, appears from the middle right side
#D after about one thousand generations. The gliders go
#D in and come out backwards -- that is, 1's place first.
#D That way, the numbers to be added can be arbitrarily
#D large.
#N
#P -56 -95
**
..*
...*
#P -63 -92
..*.......*
**........*
*..**....*
.*****.**
..*
#P -78 -93
...........**
...........**
........**
.......***
........**
..**.......**
.*.*.......**
.*
**
#P -83 -79
**
.*
.*.*.......**
..**.......**....*
........**......****
.......***.....*..**
........**.....**
...........**....*
...........**
#P -49 -90
...**
...*.*
.....*
.....**
.
.
.
.
........**
.........*
.........*.*.....*
..........**....*.*
..............**...*
....*.........**...*
..*.*.........**...*
...**...........*.*
.................*
........***
**........*
**.......*
.
.
.
.
.
.
......**
......*
........*..........*
.......****......*.*
......*....*......**
......**..**
#P -51 -56
..............***
..............***
.....***.....*...*
............*.....*..*.*
.....*.*.....*...*....**
....*****.....***.....*
...**...**
...**...**
.
.
...**
.**.*
.*
............**
..***.*......*
......*...***
......*...*
.
.
.
.
.**...**
...***
..*...*
...*.*
....*
.
.**
..*
**
#P -63 -75
*.**
....*
.....*
.....*
.....*
....*
..**
.
.
...*
.***
*
**
.
.
.
.
.......***
.........*
*.......*
**
**
.......***
.......*
**......*
*.**
...*
#P -63 -47
***
.
.
.
.
.
.
..**
**
..*
.*
*
.
..**
..*
...***
.....*
.
.
.
...........*
...........*
#P -68 -59
..***
.
..*.*
.****
**
**
#P -66 -47
.*
.*
.*
.
.
.
.
**
..*
.*
..*
#P 64 -22
**
*.*
#P 66 -20
*
**
#P -40 4
*
***
#P -38 6
.*
**
#P -47 15
...........***
..........*...*
.........*.....*
..........*...*
...........***
...........***
.
.
.........**
..........*.....**
.......***......*.*
......*.........*
.......***
.........***
............*
...........**
.
.
.
.
.
..............*
.............***
............*****
...........**...**
.
.
.
.............***
.............***
.
*..........**
***.........*
...*.....***
..**.....*
.
.
.
.
.....*
....***
...*****
..*.*.*.*
..**...**
.
.
.....*
....*.*
#P -62 63
.....................*....**
.................*..*....*.*
.................*.........*
..................*
...............***
...............*
........*
......***
.....*
.....**........................*
..............................**
.......................**.....*.*
.......................**
.
.
...........**
..***.....*.*
.*...*......*
*.....*
*.....*
..............**
......*.......*.*.....***
.....**.......*......*...*
.....**.............*.....*
...*..**............*.....*
....*.*
....**..............*
....................**
....................**
..**...**..........**..*
..**...**...........*.*
.....................**
....***
....***
.....*............**...**
..................**...**
.
....................***
.......**...........***
.......*.............*
........***
..........*
.
..................**
...................*
................***
................*
#P 65 21
..**
..*
*.*
#P 65 24
**
#P 67 49
*
***
...*
..**
.
.
.
.
.
..**...**
..*.....*
#P 65 61
.**..*...*
**....***
..*
.
.
.
.
.
.....*
...**.**
.
..*.....*
.
..**.*.**
#P 65 81
..**
...*
***
#P 65 84
*
#P 22 99
.**
**
..*
#P 22 102
.
.
.
#P 38 111
.
.
.
#P 37 114
.**
**
..*
#P 13 -16
*
.*
#P 15 -17
*
*
*
#P 29 -17
...**
.
**
.*
.*.*
#P 31 -12
**
.
.....*
...**
#P 50 -15
**
*
#P 48 -13
*.*
**
#P 39 -13
**
*..*
....*
....*
#P 39 -9
....*
*..*
**
#P -6 -7
**
.**
*
#P -6 -3
.
.
.
#P 8 -8
*......*.*
***.....**
...*....*
..**
.
....***
....***
#P 10 -1
.*...*
*.....*
.*...*
..***
#P 36 6
**
*
.***
#P 33 9
**....*
*.*
..*
..**
#P -21 8
**
.**
#P -21 10
*
#P 2 11
........**
.........*
......***
......*
.
**
.*
.*.*......*.*
..**....*...*
........*
#P 9 21
*....*
.*
.*...*
...*.*
.
.*
..**
.**
#P 33 19
**
.*
.*.*
#P 35 22
**
#P 42 21
..**
.*.*
*
*..*..*
*
.*.*
..**
#P 49 23
**....*
..*..*.*
***.*.**
...**.**
....*.**
.....*.*
......*
#P 21 23
**
*.*
#P 23 25
*
**
#P -6 33
**
#P -7 34
*.*
..*
#P -16 39
**
#P -16 40
*.*
*
#P 34 45
....*
.****
****
#P 34 48
*..*
****
.****
....*
#P -21 48
**
#P -22 49
*.*
..*
#P 11 50
.................**
................*.*
................*
...............**
.
.
.
...........**
..........***
**.....*.**
**.....*..*........***
.......*.**
..........***..**..*
...........**..*...*
................*..*
................**
#P 6 69
........**...*
........*.*..*.*
........*....**
.
.
.
**..............**........*
.*..............*..*......*
.*.*.......**..*...*
..**......***..**..*
.......*.**
.......*..*........***....*
.......*.**...............*
..........***
...........**
..**
.**
...*
#P 39 50
......**
......*.*
........*
........**
.
.
.
......**
......*
....*.*
*...**
.*
..*
.*........*
*.........*
#P 50 54
.**
*..*
...*
...*
.*.*
.*.*
..*
.
.
*...**
.....*
.
*...*..**
.***....**
.......*
#P -1 54
**
#P -1 55
*.*
*
#P 37 59
*
*
.*
.*
#P 37 63
.*
*
*
#P 33 76
.*
*.*
*..*
*.*
.*
#P 38 73
..**
..*
*.*
**
#P 51 74
...*
.**.**
.
*.....*
#P 51 79
**.*.**
#P -16 87
*
#P -17 88
**
*.*
#P 56 86
**
*
#P 57 88
***
..*
#P -8 -129
..........*
........***
.......*
.......**
.
................*
.....*..........***
.....*.............*
....*.*...........**
...**.**
..*.....*
.....*...............*
..**...**............*
....................*.*
...................**.**
...****...........*.....*
...*..**.............*
....*.**..........**...**
.
.....**
......*.............****
...................**..*
...................**.*
**.*.**
*.....*.....*.......**
.*...*.......*......*
..***......***
.
....................**.*.**
..............*.....*.....*
.............*.......*...*
.............***......***
.
.
..**................................*
..**..............................***
.................................*
#P -10 -92
......................**...........**
.......................*
....................***
....................*
................*
................***
...................*
.*................**
*
***.......*....................*****
........***...................*.***.*
.......*.......................*...*
.......**.......................***
.................................*
....................***
...................*...*
..................*.....*
..................*.....*......*
.....................*.........*
....***............*...*......*.*.....*
...*...*............***......**.**..*.*
..*.....*............*......*.....*..**
..*.....*......................*
.....*......................**...**
...*...*..............***
....***...............***
.....*...............*...*......*
...............*.*..............*
...............**...**...**......*
..***...........*
..***
.*...*........................**
.........*.*..................**
**...**...**
..........*
#P 34 -90
*
***
...*
..**
#P 34 -86
.
.
.
.
#P -20 -82
**
*
#P -22 -80
*.*
**
#P 36 -78
.*****
*.***.*
.*...*
..***
...*
#P 34 -70
.......*
.......*
*.....*.*
*.*..**.**
**..*.....*
.......*
....**...**
#P -25 -70
.*
*
#P -25 -68
***
#P -25 -63
*.*
.**
.*
#P -22 -63
.
.
.
#P 38 -58
**
.*
#P 36 -56
***
*
#P 13 -54
**
**
#P 13 -52
.
.
#P 19 -53
*
*.*
**
#P 19 -49
.
.
.
#P -5 -51
**
*
.***
...*
#P -5 -47
.
.
.
.
#P -17 -47
..*
*.*
.**
#P -17 -43
.
.
.
#P -10 -48
*
.*
.*
#P -8 -48
*
*
#P 14 -45
*
#P 15 -45
.*
**
*
#P 23 -44
...*
.***
*
#P 23 -41
**
#P -15 -38
*.*
.**
.*
#P -15 -34
.
.
.
#P -2 -38
......*
......*.*
......**
.
.
.......*.*
..*.....**
*.*.....*
.**
.........*
#P 0 -28
.......*.*
.......**
.
.
.
*.*
.**
.*
#P 18 -36
..*
.**
.**
.**
**
#P 21 -36
**
.**
.**
***
..**
#P 23 -25
**
*
#P 24 -23
***
..*
#P 41 -25
..**
.*.*
*
#P 41 -22
*..*
*
.*.*
..**
#P 47 -24
....*
.***
*..*
.**
#P 52 -27
..*
.*.*
*.**
*.**
*.**
.*.*
..*
#P 33 -20
.**
*.*
#P 33 -18
*