Switch to edit mode.
Name(s): forward f back b1: if ((t = this:has_tick(player)) == 0)
2: $msg:mtell("nogo")
3: elseif (this:exit_ahead() && verb[1] == "f")
4: this:finished()
5: else
6: q = this:("wall_" + (verb[1] == "f" ? "ahead" | "behind"))(t.maze_layout[t.cur_sq[1]][t.cur_sq[2]])
7: if (q || (verb[1] == "f" && this:enter_ahead()))
8: $msg:mtell("ouch")
9: else
10: if (verb[1] == "b")
11: t.dir = (t.dir + 1) % 4 + 1
12: if (this:enter_ahead())
13: $msg:mtell("ouch")
14: return t.dir = (t.dir + 1) % 4 + 1
15: elseif (this:exit_ahead())
16: return this:finished()
17: endif
18: t.dir = (t.dir + 1) % 4 + 1
19: endif
20: d = verb[1] == "f" ? t.dir | (t.dir + 1) % 4 + 1
21: for x in [1..2]
22: t.cur_sq[x] = t.cur_sq[x] + t.movement[d][x]
23: endfor
24: t.moves = t.moves + 1
25: player.location:look()
26: endif
27: endif