Created
October 15, 2018 13:03
-
-
Save pierrealexaline/9d41270e777e004837c39b1917c6afb6 to your computer and use it in GitHub Desktop.
Php conditions 1
This file contains hidden or 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 | |
| $weapons = ['fists', 'whip', 'gun']; | |
| $opponentWeapon = $weapons[rand(0,2)]; // Cela permet de choisir une arme de manière aléatoire. | |
| if($opponentWeapon == 0){ $indyWeapon = 2; } | |
| elseif($opponentWeapon == 1){ $indyWeapon = 0; } | |
| elseif($opponentWeapon == 2){ $indyWeapon = 1; } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment