Last active
September 8, 2015 04:20
-
-
Save yandod/35c5af104744f7745d5f to your computer and use it in GitHub Desktop.
phpwarrior/beginner-level2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Player { | |
public function play_turn($warrior) { | |
switch (true) { | |
case $warrior->feel()->is_enemy(): | |
$warrior->attack(); | |
break; | |
default: | |
$warrior->walk(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment