-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRight.agc
122 lines (85 loc) · 2.13 KB
/
Right.agc
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# See Down.agc for detailed explanation of how the code
# to move and combine numbers works. The only differences between them
# is to reverse directions and/or swap rows for columns (if horizontal)
MOVE_RT
TC SETUPMOV # Setup a table and check if can proceed - may never return!
CA GM_DONE # Load game complete status into A
EXTEND
BZF MOVING_RT # Flag is zero, not complete yet
TCF MAINLOOP
MOVING_RT
CA STA_RIGHT
TS GM_STATE
CA ZERO
TS PLAY_ID
CA DEC3
TS COL_ID
R_COLOOP
INDEX COL_ID
CA COL_STRT
TS CUR_ID
AD DEC15
TS END_ID
R_ROLOOP
INDEX CUR_ID
CA GRID_ROW
TS CELLROW
INDEX CUR_ID
CA VALUES
TS CELL_VALUE
AD DEC1
EXTEND
BZF R_NOROW
CHK_RT
CA CUR_ID
AD DEC1
TS CHK_ID
INDEX CHK_ID
CA VALUES
TS CHK_VALUE
AD DEC1
EXTEND
BZF MOV_RT
R_SOMEHR
INDEX CELLROW
CA MATCHMD
EXTEND
BZF R_NOMAT
TCF R_NOROW
R_NOMAT
CA CELL_VALUE
EXTEND
SU CHK_VALUE
EXTEND
BZF R_MATCH
TCF R_NOROW
R_MATCH
INDEX CELLROW
INCR MATCHMD # Set flag that we have combined in this column
TC UPGRADE # Increase target cell, empty orig cell
TCF R_NOROW
MOV_RT
INCR PLAY_ID
CA CELL_VALUE
INDEX CHK_ID
TS VALUES
CA NEG_ONE
INDEX CUR_ID
TS VALUES
R_NOROW
CA CUR_ID
AD DEC5
TS CUR_ID
EXTEND
SU END_ID
EXTEND
BZF R_NXTCOL
TCF R_ROLOOP
R_NXTCOL
TS NEWJOB
CA COL_ID
EXTEND
BZF D_DONE
EXTEND
DIM COL_ID
TCF R_COLOOP