Skip to content

Instantly share code, notes, and snippets.

View F4R3LL's full-sized avatar
🌴
Working from vacation.

Fernandes F4R3LL

🌴
Working from vacation.
View GitHub Profile
@F4R3LL
F4R3LL / Ruby_Warrior_Level_6.rb
Last active November 23, 2017 08:42
#Bloc.io - ruby-warrior - Level 6
class Player
def play_turn(warrior)
if warrior.feel.stairs? && !warrior.feel.captive? && !warrior.feel.enemy?
warrior.walk!
elsif warrior.feel(:backward).captive?
warrior.rescue!:backward
elsif !warrior.feel(:backward).wall? && @hitWall != 1
warrior.walk!:backward
@hitWall = 1
elsif warrior.feel.enemy?