-
Notifications
You must be signed in to change notification settings - Fork 4
/
unflip.c
49 lines (31 loc) · 836 Bytes
/
unflip.c
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.c
Created: February 26, 1999
Modified: July 12, 1999
Author: Gunnar Andersson ([email protected])
Contents: Low-level code to flip back the discs flipped by a move.
*/
#include "macros.h"
#include "unflip.h"
/* Global variables */
int *global_flip_stack[2048];
int **flip_stack = &(global_flip_stack[0]);
/*
UNDOFLIPS
Flip back the FLIP_COUNT topmost squares on GLOBALFLIPSTACK.
This seems to be the fastest way to do it and doesn't matter
much anyway as this function consumes a negligible percentage
of the time.
*/
INLINE void
UndoFlips( int flip_count, int oppcol ) {
UndoFlips_inlined( flip_count, oppcol );
}
/*
INIT_FLIP_STACK
Reset the flip stack.
*/
void
init_flip_stack( void ) {
flip_stack = &global_flip_stack[0];
}