The MAP Syntax
- gameoflifemaniac
- Posts: 1242
- Joined: January 22nd, 2017, 11:17 am
- Location: There too
The MAP Syntax
How does the MAP syntax work?
I was so socially awkward in the past and it will haunt me for the rest of my life.
Code: Select all
b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!
Re: The MAP syntax
It's explained in the new Golly.
A string of 512 binary digits containing info on births and deaths is then summarised in base 64.
A string of 512 binary digits containing info on births and deaths is then summarised in base 64.
Re: The MAP syntax
This answer to a MAP-related question might also be useful to walk through. It's a little hard to wrap one's head around at first -- the position of each binary digit is itself a neighborhood pattern encoded in binary. Same kind of thing as Wolfram rule numbering.gameoflifemaniac wrote:How does the MAP syntax work?
Re: The MAP syntax
In the same way, to make modifications yourself, choose a transition. Mine will be B7e(South).dvgrn wrote:This answer to a MAP-related question might also be useful to walk through. It's a little hard to wrap one's head around at first -- the position of each binary digit is itself a neighborhood pattern encoded in binary. Same kind of thing as Wolfram rule numbering.gameoflifemaniac wrote:How does the MAP syntax work?
101
101
111
which is in decimal 367 = 61*6+1
position 61 of the CGoL MAP is I (8 in decimal): 001000; add the 1 at position 1 = 011000 (decimal 24 --> base 64 is Y).
Switching at position 64 I for Y:
Code: Select all
x = 15, y = 15, rule = MAPARYXfhZofugWaH7oaIDogBZofuhogOiAaIDogIAAgAAWaH7oaIDogGiA6ICAAYAAaIDogIAAgACAAIAAAAAAAA
6b3o$6bobo$6bobo4$3o9b3o$o13bo$3o9b3o4$6bobo$6bobo$6b3o!
- gameoflifemaniac
- Posts: 1242
- Joined: January 22nd, 2017, 11:17 am
- Location: There too
Re: The MAP syntax
Where does the 61 come from?Rhombic wrote:In the same way, to make modifications yourself, choose a transition. Mine will be B7e(South).dvgrn wrote:This answer to a MAP-related question might also be useful to walk through. It's a little hard to wrap one's head around at first -- the position of each binary digit is itself a neighborhood pattern encoded in binary. Same kind of thing as Wolfram rule numbering.gameoflifemaniac wrote:How does the MAP syntax work?
101
101
111
which is in decimal 367 = 61*6+1
position 61 of the CGoL MAP is I (8 in decimal): 001000; add the 1 at position 1 = 011000 (decimal 24 --> base 64 is Y).
Switching at position 64 I for Y:Code: Select all
x = 15, y = 15, rule = MAPARYXfhZofugWaH7oaIDogBZofuhogOiAaIDogIAAgAAWaH7oaIDogGiA6ICAAYAAaIDogIAAgACAAIAAAAAAAA 6b3o$6bobo$6bobo4$3o9b3o$o13bo$3o9b3o4$6bobo$6bobo$6b3o!
I was so socially awkward in the past and it will haunt me for the rest of my life.
Code: Select all
b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!
- gameoflifeboy
- Posts: 474
- Joined: January 15th, 2015, 2:08 am
Re: The MAP syntax
The transition B7e(south) is encoded by the binary number 101101111, found by reading across the rows of the 3 by 3 grid of cells. This number in decimal is 367, so we need to look at the 367th bit of the MAP rule string. Since each character in this string takes up 6 bits, we need to divide 367 by 6. 367/6 is 61 with a remainder of 1, so we look at the 61st character of the rule string. This character is 'I', which encodes the binary string 001000. The relevant bit here is the second digit, and it is 0 because B7e(south) is not part of the rule and thus the 3 by 3 configuration produces an off cell. To make the configuration produce an on cell instead, we need to change this 0 to a 1, which changes the binary string to 011000, encoded by 'Y'. Thus, changing the I at position 61 to a Y adds the B7e(south) transition to the rule.gameoflifemaniac wrote:Where does the 61 come from?
- gameoflifemaniac
- Posts: 1242
- Joined: January 22nd, 2017, 11:17 am
- Location: There too
Re: The MAP syntax
Thanks very much! So different characters in the same position can mean the same, right?gameoflifeboy wrote:The transition B7e(south) is encoded by the binary number 101101111, found by reading across the rows of the 3 by 3 grid of cells. This number in decimal is 367, so we need to look at the 367th bit of the MAP rule string. Since each character in this string takes up 6 bits, we need to divide 367 by 6. 367/6 is 61 with a remainder of 1, so we look at the 61st character of the rule string. This character is 'I', which encodes the binary string 001000. The relevant bit here is the second digit, and it is 0 because B7e(south) is not part of the rule and thus the 3 by 3 configuration produces an off cell. To make the configuration produce an on cell instead, we need to change this 0 to a 1, which changes the binary string to 011000, encoded by 'Y'. Thus, changing the I at position 61 to a Y adds the B7e(south) transition to the rule.gameoflifemaniac wrote:Where does the 61 come from?
I was so socially awkward in the past and it will haunt me for the rest of my life.
Code: Select all
b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!
Re: The MAP syntax
If I'm understanding the question right, no. Any change to the MAP string will change what happens in one of the 512 possible neighborhoods.gameoflifemaniac wrote:Thanks very much! So different characters in the same position can mean the same, right?
Each character encodes six neighborhoods (because MAP strings use a base-64 code, and 64 = 2^6). So any valid change in a character will change one or more bits from 0 to 1, or 1 to 0. When Golly/LifeViewer sees the relevant neighborhood, it will set the state of the center cell differently depending on the new state of that bit.
- gameoflifemaniac
- Posts: 1242
- Joined: January 22nd, 2017, 11:17 am
- Location: There too
Re: The MAP syntax
What would be the syntax for Wolfram 22?
I was so socially awkward in the past and it will haunt me for the rest of my life.
Code: Select all
b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!
Re: The MAP syntax
You can figure that out for yourself. Use Rhombic's script. Start with an all-OFF MAP stringgameoflifemaniac wrote:What would be the syntax for Wolfram 22?
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
(or the script gives you that by default if you enter an empty string).
You only need to change three transitions to get W22: if a single neighbor is ON to the NW, N, or NE then the center cell turns on.
So you flip the three bits 100000000, 010000000, and 001000000 with Rhombic's script, and you get
Code: Select all
x = 1, y = 1, rule = MAPAAAAAAAAAACAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
o!
#C [[ STOP 1023 THEME 8 AUTOSTART AUTOFIT HISTORYFIT THUMBNAIL THUMBSIZE 2 ]]
AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//w
is equivalent to B/S012345678, which is a good place to start... Seems to work as a base to produce a staying-ON version of Wolfram Rule 22:
Code: Select all
x = 1, y = 1, rule = MAPAAD//wAA//+AAP//AAD//4AA//8AAP//AAD//wAA//+AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//w
o!
#C [[ STOP 1023 AUTOSTART AUTOFIT ]]