-
Notifications
You must be signed in to change notification settings - Fork 4
/
unflip.h
49 lines (31 loc) · 1.17 KB
/
unflip.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
File: unflip.h
Created: February 26, 1999
Modified: December 25, 1999
Author: Gunnar Andersson (gunnar@radagast.se)
Contents: Low-level macro code to flip back the discs
flipped by a move.
*/
#ifndef UNFLIP_H
#define UNFLIP_H
extern int *global_flip_stack[2048];
extern int **flip_stack;
#define UndoFlips_inlined( flip_count, oppcol ) { \
int UndoFlips__flip_count = (flip_count); \
int UndoFlips__oppcol = (oppcol); \
\
if ( UndoFlips__flip_count & 1 ) { \
UndoFlips__flip_count--; \
* (*(--flip_stack)) = UndoFlips__oppcol; \
} \
while ( UndoFlips__flip_count ) { \
UndoFlips__flip_count -= 2; \
* (*(--flip_stack)) = UndoFlips__oppcol; \
* (*(--flip_stack)) = UndoFlips__oppcol; \
} \
}
void
UndoFlips( int flip_count, int oppcol );
void
init_flip_stack( void );
#endif /* UNFLIP_H */