diff options
| -rw-r--r-- | TODO.md | 13 | ||||
| -rw-r--r-- | src/cubetypes.h | 16 | ||||
| -rw-r--r-- | src/fst.c | 58 | ||||
| -rw-r--r-- | src/fst.h | 12 |
4 files changed, 92 insertions, 7 deletions
| @@ -4,6 +4,12 @@ This is a list of things that I would like to add or change at some point. | |||
| 4 | It's more of a personal reminder than anything else. | 4 | It's more of a personal reminder than anything else. |
| 5 | 5 | ||
| 6 | ## After symcoord | 6 | ## After symcoord |
| 7 | ### fst_cube | ||
| 8 | * slightly different from cube in v2.0.2: each "side" coordinate | ||
| 9 | is a transformation of the other, not an eorl or similar (changes | ||
| 10 | the permutation!) | ||
| 11 | * inverse: for edges, just generate ep[12] and convert back | ||
| 12 | * corners: big table (150Mb if 16bit integers are used) | ||
| 7 | ### Solving standard coordinates | 13 | ### Solving standard coordinates |
| 8 | * add Void * extradata to DfsArg and a custom move function | 14 | * add Void * extradata to DfsArg and a custom move function |
| 9 | * add optional custom pre-process for generating special table (nx) | 15 | * add optional custom pre-process for generating special table (nx) |
| @@ -12,13 +18,6 @@ It's more of a personal reminder than anything else. | |||
| 12 | * implement nxopt with all tables and all tricks | 18 | * implement nxopt with all tables and all tricks |
| 13 | (maybe compile time variable for maximum memory to use?) | 19 | (maybe compile time variable for maximum memory to use?) |
| 14 | * is_valid should also unniss / cleanup the alg | 20 | * is_valid should also unniss / cleanup the alg |
| 15 | ### fst_cube | ||
| 16 | * slightly different from cube in v2.0.2: each "side" coordinate | ||
| 17 | is a transformation of the other, not an eorl or similar (changes | ||
| 18 | the permutation!) | ||
| 19 | * add fst_index for some coordinates? | ||
| 20 | * inverse: for edges, just generate ep[12] and convert back | ||
| 21 | * corners: big table (150Mb if 16bit integers are used) | ||
| 22 | 21 | ||
| 23 | ## For version 2.1 | 22 | ## For version 2.1 |
| 24 | ### Changes to Step and Solve | 23 | ### Changes to Step and Solve |
diff --git a/src/cubetypes.h b/src/cubetypes.h index f9b4011..bb1ad10 100644 --- a/src/cubetypes.h +++ b/src/cubetypes.h | |||
| @@ -90,6 +90,7 @@ typedef struct commandargs CommandArgs; | |||
| 90 | typedef struct coordinate Coordinate; | 90 | typedef struct coordinate Coordinate; |
| 91 | typedef struct cube Cube; | 91 | typedef struct cube Cube; |
| 92 | typedef struct dfsarg DfsArg; | 92 | typedef struct dfsarg DfsArg; |
| 93 | typedef struct fstcube FstCube; | ||
| 93 | typedef struct indexer Indexer; | 94 | typedef struct indexer Indexer; |
| 94 | typedef struct movable Movable; | 95 | typedef struct movable Movable; |
| 95 | typedef struct moveset Moveset; | 96 | typedef struct moveset Moveset; |
| @@ -226,6 +227,21 @@ dfsarg | |||
| 226 | }; | 227 | }; |
| 227 | 228 | ||
| 228 | struct | 229 | struct |
| 230 | fstcube | ||
| 231 | { | ||
| 232 | uint16_t uf_eofb; | ||
| 233 | uint16_t uf_eposepe; | ||
| 234 | uint16_t uf_coud; | ||
| 235 | uint16_t uf_cp; | ||
| 236 | uint16_t fr_eofb; | ||
| 237 | uint16_t fr_eposepe; | ||
| 238 | uint16_t fr_coud; | ||
| 239 | uint16_t rd_eofb; | ||
| 240 | uint16_t rd_eposepe; | ||
| 241 | uint16_t rd_coud; | ||
| 242 | } | ||
| 243 | |||
| 244 | struct | ||
| 229 | indexer | 245 | indexer |
| 230 | { | 246 | { |
| 231 | int n; | 247 | int n; |
diff --git a/src/fst.c b/src/fst.c new file mode 100644 index 0000000..91c022a --- /dev/null +++ b/src/fst.c | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | #define FST_C | ||
| 2 | |||
| 3 | #include "fst.h" | ||
| 4 | |||
| 5 | static void fst_to_ep(FstCube fst, int *ep); | ||
| 6 | |||
| 7 | FstCube | ||
| 8 | cube_to_fst(Cube *cube) | ||
| 9 | { | ||
| 10 | Cube c; | ||
| 11 | FstCube ret; | ||
| 12 | |||
| 13 | copy_cube(cube, &c); | ||
| 14 | ret.uf_eofb = index_eofb(&c); | ||
| 15 | ret.uf_eposepe = index_eposepe(&c); | ||
| 16 | ret.uf_coud = index_coud(&c); | ||
| 17 | ret.uf_cp = index_cp(&c); | ||
| 18 | copy_cube(cube, &c); | ||
| 19 | transform_cube(fr, &c); | ||
| 20 | ret.fr_eofb = index_eofb(&c); | ||
| 21 | ret.fr_eposepe = index_eposepe(&c); | ||
| 22 | ret.fr_coud = index_coud(&c); | ||
| 23 | transform_cube(rd, &c); | ||
| 24 | ret.rd_eofb = index_eofb(&c); | ||
| 25 | ret.rd_eposepe = index_eposepe(&c); | ||
| 26 | ret.rd_coud = index_coud(&c); | ||
| 27 | |||
| 28 | return ret; | ||
| 29 | } | ||
| 30 | |||
| 31 | FstCube | ||
| 32 | fst_inverse(FstCube fst) | ||
| 33 | { | ||
| 34 | /* TODO */ | ||
| 35 | } | ||
| 36 | |||
| 37 | FstCube | ||
| 38 | fst_move(Move m, FstCube fst) | ||
| 39 | { | ||
| 40 | /* TODO */ | ||
| 41 | } | ||
| 42 | |||
| 43 | void | ||
| 44 | fst_to_cube(FstCube fst, Cube *cube) | ||
| 45 | { | ||
| 46 | invindex_eofb((uint64_t)fst.uf_eofb, cube); | ||
| 47 | fst_to_ep(fst, cube->ep); | ||
| 48 | invindex_coud((uint64_t)fst.uf_coud, cube); | ||
| 49 | invindex_cp((uint64_t)fst.uf_cp, cube); | ||
| 50 | } | ||
| 51 | |||
| 52 | static void | ||
| 53 | fst_to_ep(FstCube fst, int *ep) | ||
| 54 | { | ||
| 55 | /* TODO */ | ||
| 56 | } | ||
| 57 | |||
| 58 | #endif | ||
diff --git a/src/fst.h b/src/fst.h new file mode 100644 index 0000000..94f6c30 --- /dev/null +++ b/src/fst.h | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | #ifndef FST_H | ||
| 2 | #define FST_H | ||
| 3 | |||
| 4 | #include "coord.h" | ||
| 5 | |||
| 6 | FstCube cube_to_fst(Cube *cube); | ||
| 7 | FstCube fst_inverse(FstCube fst); | ||
| 8 | FstCube fst_move(Move m, FstCube fst); | ||
| 9 | void fst_to_cube(FstCube fst, Cube *cube); | ||
| 10 | |||
| 11 | #endif | ||
| 12 | |||
