diff options
Diffstat (limited to '')
| -rw-r--r-- | README.md | 105 |
1 files changed, 29 insertions, 76 deletions
| @@ -129,27 +129,24 @@ Then you can for example get a cube from a sequence of moves: | |||
| 129 | 129 | ||
| 130 | ``` | 130 | ``` |
| 131 | $ ./run frommoves -moves "R' U' F" | 131 | $ ./run frommoves -moves "R' U' F" |
| 132 | JLQWSVUH=ZLCUABGIVTKH | 132 | JLQWSVUH=ZLCUABGIVTKH=A |
| 133 | ``` | 133 | ``` |
| 134 | 134 | ||
| 135 | Or you can get a random cube | 135 | The cube format is meant to be easy to copy-paste and read for the |
| 136 | software, but not necessarily intuitive for the user. See below for a | ||
| 137 | detaileed description. | ||
| 136 | 138 | ||
| 137 | ``` | 139 | You can also get a random cube |
| 138 | $ ./run randomcube | ||
| 139 | WDSQREVX=VBKYDUCJXWAb | ||
| 140 | ``` | ||
| 141 | |||
| 142 | If you don't like this format, you can convert it: | ||
| 143 | 140 | ||
| 144 | ``` | 141 | ``` |
| 145 | $ ./run convert -fin B32 -fout H48 -cubestr "WDSQREVX=VBKYDUCJXWAb" | 142 | $ ./run randomcube |
| 146 | UL1 UB0 BL0 FR1 DF0 UR1 DB0 FL0 DR1 DL1 UF0 BR1 DFR2 DBR0 DFL2 UFR2 UBL2 UFL0 UBR2 DBL2 | 143 | WDSQREVX=VBKYDUCJXWAb=A |
| 147 | ``` | 144 | ``` |
| 148 | 145 | ||
| 149 | To solve a cube you can use: | 146 | To solve a cube you can use: |
| 150 | 147 | ||
| 151 | ``` | 148 | ``` |
| 152 | $ ./run solve -solver h48h0k4 -n 1 -M 4 -cube "JLQWSVUH=ZLCUABGIVTKH" | 149 | $ ./run solve -solver h48h0k4 -n 1 -M 4 -cube "JLQWSVUH=ZLCUABGIVTKH=A" |
| 153 | F' U' R | 150 | F' U' R |
| 154 | ``` | 151 | ``` |
| 155 | 152 | ||
| @@ -244,8 +241,8 @@ $ python # In the main folder | |||
| 244 | From here you can call the library functions directly, for example: | 241 | From here you can call the library functions directly, for example: |
| 245 | 242 | ||
| 246 | ``` | 243 | ``` |
| 247 | >>> nissy.compose("NEORSQLH=ZFCYUAGLHTKB", "NEORSQLH=ZFCYUAGLHTKB") | 244 | >>> nissy.compose('NEORSQLH=ZFCYUAGLHTKB=A', 'NEORSQLH=ZFCYUAGLHTKB=A') |
| 248 | 'ASTUGFBH=DACXEZGBLIKF' | 245 | 'ASTUGFBH=DACXEZGBLIKF=A' |
| 249 | ``` | 246 | ``` |
| 250 | 247 | ||
| 251 | The `python/examples` folder contains some examples, that you | 248 | The `python/examples` folder contains some examples, that you |
| @@ -261,94 +258,50 @@ with the comments in nissy.h for more details. | |||
| 261 | 258 | ||
| 262 | NOTE: Support for the Python module is still rudimentary. | 259 | NOTE: Support for the Python module is still rudimentary. |
| 263 | 260 | ||
| 264 | ## Cube formats | 261 | ## Cube format |
| 265 | |||
| 266 | The cube is represented as a string in one of the following formats, | ||
| 267 | all explained below: | ||
| 268 | |||
| 269 | * H48 | ||
| 270 | * LST | ||
| 271 | * B32 (the default) | ||
| 272 | |||
| 273 | In all of the formats, the permutation of the center pieces is not | ||
| 274 | stored. This means that the cube is assumed to be in a fixed orientation. | ||
| 275 | |||
| 276 | More formats will become available in the future. | ||
| 277 | |||
| 278 | ### Cube format: H48 | ||
| 279 | 262 | ||
| 280 | In the H48 format, each edge is represented by two letters denoting the | 263 | This format is a "base 32" encoding of the cube. It is not meant to be |
| 281 | sides it belongs to and one number denoting its orientation (0 oriented, 1 | 264 | human-readable, but it is compact while still being plain text. Each |
| 282 | mis-oriented). Similarly, each corner is represented by three letters and | 265 | piece, including the orientation value, is encoded as a number from 0 |
| 283 | a number (0 oriented, 1 twisted clockwise, 2 twisted counter-clockwise). | 266 | to 31, and this number is then converted to an uppercase letter (0-26) |
| 284 | 267 | or to a lowercase letter (27-31). | |
| 285 | The solved cube looks like this: | ||
| 286 | |||
| 287 | ``` | ||
| 288 | UF0 UB0 DB0 DF0 UR0 UL0 DL0 DR0 FR0 FL0 BL0 BR0 UFR0 UBL0 DFL0 DBR0 UFL0 UBR0 DFR0 DBL0 | ||
| 289 | ``` | ||
| 290 | 268 | ||
| 291 | The cube after the move F looks like this: | 269 | The format looks like this: |
| 292 | 270 | ||
| 293 | ``` | 271 | ``` |
| 294 | FL1 UB0 DB0 FR1 UR0 UL0 DL0 DR0 UF1 DF1 BL0 BR0 UFL1 UBL0 DFR1 DBR0 DFL2 UBR0 UFR2 DBL0 | 272 | cccccccc=eeeeeeeeeeee=r |
| 295 | ``` | 273 | ``` |
| 296 | 274 | ||
| 297 | Whitespace (including newlines) between pieces is ignored when reading the | 275 | Where the first 8 characters represent the corner, the 12 characters |
| 298 | cube. A single whitespace character is added between pieces when writing. | 276 | after the first 12 represent the edges and the last character represents |
| 299 | 277 | the orientation of the cube with respect to the base orientation. | |
| 300 | You can find more examples of this format in the utils/cubes folder. | ||
| 301 | |||
| 302 | ## Cube format: LST | ||
| 303 | |||
| 304 | In the LST format, a cube is represented by a comma-separated list of | ||
| 305 | integers. Each piece is represented by an (unsigned) 8-bit integer. The 4 | ||
| 306 | least-significant bits determine which piece it is, the other 4 determine | ||
| 307 | the orientation. | ||
| 308 | 278 | ||
| 309 | Edges are numbered as follows (see also constants.h): | 279 | Edges are numbered as follows (see also constants.h): |
| 310 | 280 | ||
| 311 | UF=0 UB=1 DB=2 DF=3 UR=4 UL=5 DL=6 DR=7 FR=8 FL=9 BL=10 BR=11 | ||
| 312 | |||
| 313 | Corners are numbered as follows: | ||
| 314 | |||
| 315 | UFR=0 UBL=1 DFL=2 DBR=3 UFL=4 UBR=5 DFR=6 DBL=7 | ||
| 316 | |||
| 317 | The orientation of the edges is with respect to F/B, the orientation of | ||
| 318 | corners is with respect to U/D. | ||
| 319 | |||
| 320 | In this format, the solved cube looks like this: | ||
| 321 | |||
| 322 | ``` | 281 | ``` |
| 323 | 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 | 282 | UF=0 UB=1 DB=2 DF=3 UR=4 UL=5 DL=6 DR=7 FR=8 FL=9 BL=10 BR=11 |
| 324 | ``` | 283 | ``` |
| 325 | 284 | ||
| 326 | The cube after the move F looks like this: | 285 | Corners are numbered as follows: |
| 327 | 286 | ||
| 328 | ``` | 287 | ``` |
| 329 | 36, 1, 38, 3, 66, 5, 64, 7, 25, 1, 2, 24, 4, 5, 6, 7, 16, 19, 10, 11 | 288 | UFR=0 UBL=1 DFL=2 DBR=3 UFL=4 UBR=5 DFR=6 DBL=7 |
| 330 | ``` | 289 | ``` |
| 331 | 290 | ||
| 332 | ### Cube format: B32 | 291 | At the moment, the only orientation supported is the standard one, as wide |
| 333 | 292 | moves, rotations and slice moves are not supported. | |
| 334 | This format is a "base 32" encoding of the cube. It is not meant to be | ||
| 335 | human-readable, but it is compact while still being plain text. Each | ||
| 336 | piece, including the orientation value, is encoded as a number from 0 | ||
| 337 | to 31, and this number is then converted to an uppercase letter (0-26) | ||
| 338 | or to a lowercase letter (27-31). Edges and corners are separated by a | ||
| 339 | single = character. | ||
| 340 | 293 | ||
| 341 | In this format, the solved cube looks like this: | 294 | In this format, the solved cube looks like this: |
| 342 | 295 | ||
| 343 | ``` | 296 | ``` |
| 344 | ABCDEFGH=ABCDEFGHIJKL | 297 | ABCDEFGH=ABCDEFGHIJKL=A |
| 345 | ``` | 298 | ``` |
| 346 | 299 | ||
| 347 | The cube after the move F looks like this: | 300 | The cube after the move F looks like this: |
| 348 | 301 | ||
| 349 | ``` | 302 | ``` |
| 350 | MBODSFQH=ZBCYEFGHQTKL | 303 | MBODSFQH=ZBCYEFGHQTKL=A |
| 351 | ``` | 304 | ``` |
| 352 | 305 | ||
| 353 | A cube in B32 format is always 21 characters long (22 if the terminating | 306 | A cube in B32 format is always 23 characters long (24 if the terminating |
| 354 | null character is included). | 307 | null character is included). |
