@@ -133,6 +133,38 @@ You need to manually move the generated RUL2 files from the `target` directory
133133to the correct locations in the ` Controller ` directory and then commit them into the git repository.
134134For more information on Metarules, see https://github.com/memo33/metarules .
135135
136+ #### Metarules Cheat Sheet
137+
138+ Some functions for interacting with IDs and RUL2 code effectively are listed here.
139+ Type ` sbt console ` to enter the interactive REPL. Then:
140+ ``` scala
141+ resolve(Ard3 ~ EW & Avenue ~ NS ) // convert a metarule Tile to an ID
142+ // val result = IdTile(0x51021300,2,1)
143+
144+ transduce(Ard3 ~ EW | (Road ~> Ard3 )~ EW & Avenue ~ NS ) // convert a metarule to RUL2
145+ // 0x51020000,3,0,0x04008900,0,0=0x51020000,3,0,0x51021300,2,1
146+ // 0x51020000,1,0,0x04008900,0,0=0x51020000,1,0,0x51021300,0,0
147+
148+ transduce(Sam2 ~ (0 ,0 ,11 ,3 ) | Street ~ (11 ,2 ,2 ,0 ) | % | Sam2 ~ (11 ,2 ,2 ,0 )) // alternative syntax
149+ // 0x5E571200,3,0,0x5F500900,1,0=0x5E571200,3,0,0x5E576200,1,0
150+
151+ preimage(0x57294745 ) // convert an ID to a metarule Tile
152+ // val result = List(L2Rhw8c~(0,+2,0,-2) & Glr3~(3,0,0,1))
153+
154+ preimage(IdTile (0x57294745 ,2 ,1 )) // convert an ID with rotation to a metarule Tile
155+ // val result = List(L2Rhw8c~(0,+2,0,-2) & Glr3~(1,3,0,0))
156+
157+ preimage(resolve(Street ~ (2 ,2 ,2 ,2 ))) // result can be ambiguous if multiple definitions exist
158+ // val result = List(Street~(2,2,2,2), Street~(0,2,0,2) & Street~(2,0,2,0))
159+
160+ (Road ~ (2 ,0 ,2 ,0 )).symmetries // find the symmetries of a tile
161+ // val result = Dih2A((0,0), (2,0), (0,1), (2,1))
162+ (Ard3 ~ ES & Ard3 ~ NE ).symmetries
163+ // val result = Cyc2D((0,0), (2,1))
164+ ```
165+
166+ See [ metarules] ( https://github.com/memo33/metarules ) for more details.
167+
136168### Compiling Locale Files
137169
138170To convert all the translations contained in the directory [ ltext/] ( ltext/ )
0 commit comments