![]() |
Routines |
| Prev: 8F69 | Up: Map | Next: 8FCD |
|
A random direction from 1 to 10, then the first from there on, going round, that the location has an exit in; then MOVE.
|
||||
| DO_RUN | 8FAD | LD A,$0A | A random direction, 1 to 10 | |
| 8FAF | CALL RANDOM_POSITIVE | |||
| 8FB2 | CP $00 | |||
| 8FB4 | JR Z,DO_RUN | |||
| DO_RUN_0 | 8FB6 | LD B,A | Is there a way out that way? If not, the next, round from 10 to 1 | |
| 8FB7 | CALL FIND_EXIT | |||
| 8FBA | CP B | |||
| 8FBB | JR Z,DO_RUN_1 | |||
| 8FBD | LD A,B | |||
| 8FBE | INC A | |||
| 8FBF | CP $0A | |||
| 8FC1 | JR C,DO_RUN_0 | |||
| 8FC3 | LD A,$01 | |||
| 8FC5 | JR DO_RUN_0 | |||
| DO_RUN_1 | 8FC7 | LD (ACTION),A | Go | |
| 8FCA | JP MOVE | |||
| Prev: 8F69 | Up: Map | Next: 8FCD |