This commit is contained in:
parent
47e08e5fe1
commit
a115ff2edd
4
Makefile
4
Makefile
|
@ -14,6 +14,10 @@ eleven.term: eleven.core.o eleven.term.o
|
|||
gcc $(CFLAGS) -o eleven eleven.core.o eleven.term.o
|
||||
strip eleven
|
||||
|
||||
elevenr: eleven.core.o eleven.termrot.o
|
||||
gcc $(CFLAGS) -o elevenr eleven.core.o eleven.termrot.o
|
||||
strip elevenr
|
||||
|
||||
clean:
|
||||
rm -f *.o
|
||||
rm -f eleven
|
||||
|
|
|
@ -27,6 +27,15 @@ void pr(U8* tiles){
|
|||
}}
|
||||
*/
|
||||
#define RND (rand()%SIZE)
|
||||
/* Orientation of the board, as shown by a bar:
|
||||
* 0 = bottom
|
||||
* 1 = left
|
||||
* 2 = top
|
||||
* 3 = right
|
||||
*/
|
||||
|
||||
int orientation = 0;
|
||||
|
||||
|
||||
void twist(U8* tiles){
|
||||
int i,j;
|
||||
|
@ -139,3 +148,23 @@ U32 move(U8* tiles, int way){
|
|||
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
U32 moverot(U8* tiles, int way){
|
||||
//if (way / 2) twist(tiles);
|
||||
//if (way % 2) flip(tiles);
|
||||
twist(tiles);
|
||||
flip(tiles);
|
||||
orientation = (orientation + 1) & 0x3;
|
||||
if(way==2) {
|
||||
twist(tiles);
|
||||
flip(tiles);
|
||||
twist(tiles);
|
||||
flip(tiles);
|
||||
orientation = (orientation + 2) & 0x3;
|
||||
}
|
||||
U32 n = step(tiles);
|
||||
|
||||
//if (way / 2) flip(tiles);
|
||||
return n;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue