mirror of https://github.com/dnomd343/klotski.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
1.7 KiB
71 lines
1.7 KiB
2 years ago
|
#include <cstdio>
|
||
|
|
||
|
/*
|
||
|
|
||
|
uint64_t -> 0000 + [xxx] * 20
|
||
|
|
||
|
2x2 2x1 1x2 1x1
|
||
|
# # # # # #
|
||
|
# # #
|
||
|
|
||
|
00 01 02 03
|
||
|
04 05 06 07
|
||
|
08 09 10 11
|
||
|
12 13 14 15
|
||
|
16 17 18 19
|
||
|
|
||
|
x1 (%4) => 0 1 2 3
|
||
|
x3 (%4) => 0 3 2 1
|
||
|
|
||
|
*/
|
||
|
|
||
|
/*
|
||
|
======================================================
|
||
|
|
||
|
1x1 -> 011 000 000 000 -> 0000 0000 0011 -> 0x3
|
||
|
|
||
|
1x2 -> 001 111 000 000 -> 0000 0011 1001 -> 0x39
|
||
|
|
||
|
2x1 -> 010 000 000 000 -> 0000 0000 0010 -> 0x7002
|
||
|
111 000 000 000 -> 0000 0000 0111
|
||
|
|
||
|
2x2 -> 100 111 000 000 -> 0000 0011 1100 -> 0x3F03C
|
||
|
111 111 000 000 -> 0000 0011 1111
|
||
|
|
||
|
======================================================
|
||
|
|
||
|
1x1 -> 111 000 000 000 -> 0000 0000 0111 -> 0x7
|
||
|
|
||
|
1x2 -> 111 111 000 000 -> 0000 0011 1111 -> 0x3F
|
||
|
|
||
|
2x1 -> 111 000 000 000 -> 0000 0000 0111 -> 0x7007
|
||
|
111 000 000 000 -> 0000 0000 0111
|
||
|
|
||
|
2x2 -> 111 111 000 000 -> 0000 0011 1111 -> 0x3F03F
|
||
|
111 111 000 000 -> 0000 0011 1111
|
||
|
|
||
|
======================================================
|
||
|
*/
|
||
|
|
||
|
int main() {
|
||
|
printf("Klotski engine\n");
|
||
|
|
||
|
// 0x4FEA13400
|
||
|
// # # # @ | 011 011 011 010 => 0100 1101 1011 -> 4DB
|
||
|
// * * & @ | 100 111 010 111 => 1110 1011 1100 -> EBC
|
||
|
// * * & $ | 111 111 111 010 => 0101 1111 1111 -> 5FF
|
||
|
// . + + $ | 000 001 111 111 => 1111 1100 1000 -> FC8
|
||
|
// . # ~ ~ | 000 011 001 111 => 1110 0101 1000 -> E58
|
||
|
// 0x0E58FC85FFEBC4DB
|
||
|
|
||
|
// 0x1A9BF0C00
|
||
|
// @ * * @ | 010 100 111 010 => 0101 1110 0010 -> 5E2
|
||
|
// @ * * @ | 111 111 111 111 => 1111 1111 1111 -> FFF
|
||
|
// $ ~ ~ $ | 010 001 111 010 => 0101 1100 1010 -> 5CA
|
||
|
// $ # # $ | 111 011 011 111 => 1110 1101 1111 -> EDF
|
||
|
// # . . # | 011 000 000 011 => 0110 0000 0011 -> 603
|
||
|
// 0x0603EDF5CAFFF5E2
|
||
|
|
||
|
return 0;
|
||
|
}
|