-
Notifications
You must be signed in to change notification settings - Fork 0
/
Psuedo1.txt
44 lines (35 loc) · 1.34 KB
/
Psuedo1.txt
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
While stack is not empty
# new index to consider
#onto 0 not revealed yet
if index is to 0 not revealed yet
move as far left as possible
#onto !0 not revealed yet
if index is to !0 not revealed yet
reveal tile (!0)
adv to next col
#add to stack (Lbl Z)
if on 0
add index above-left and below-left if not processed yet
while index is to 0 and still in bounds
reveal tile (0)
#adv to !0
if index is to !0
#Lbl O/2
#while loop?
while index not revealed yet
#there is possible a zero above or below (but not both)
#calculate +1 or -1 for above or below is zero or calc 0 if neither is zero
while index on covered !0 (still in range) and above or below is zero
reveal !0
addvance to next col
if index switched to a 0 hidden tile
#add to stack (Lbl Z)
if on 0
add index above-left and below-left if not processed yet
while index is to 0 and still in bounds
reveal tile (0)
else
#label F (this has a very tricky behaviour)
reveal !0
while already revealed 0 or !0
pop from stack