Skip to content

Commit

Permalink
Merge pull request #6790 from desertkaz/master
Browse files Browse the repository at this point in the history
  • Loading branch information
MahtraDR authored Mar 30, 2024
2 parents a6550ec + bc2e69b commit 6a13991
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dusk-labyrinth.lic
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,13 @@ class DuskLab
# Randomly move in directions until one works.
def wander_randomly
DRC.message("Maze reshuffled, trying to find a direction to move to")
['n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw'].each do |dir|
success = ['n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw'].each do |dir|
if move(dir)
break
break(true)
end
end
return if success

DRC.message('Unable to move to another room after maze shuffled')
DRC.message('Try to move yourself to another room then restart script')
exit
Expand Down

0 comments on commit 6a13991

Please sign in to comment.