Last active
October 2, 2019 16:41
-
-
Save Cynnah/bdd5aa33ee496deba0f365b4e822208a to your computer and use it in GitHub Desktop.
les conditions en php
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 | |
$weapons = ['fists', 'whip', 'gun']; | |
$indyWeapon = ""; | |
$opponentWeapon = $weapons[rand(0,2)]; | |
switch ($opponentWeapon) { | |
case 'fists'; | |
$indyWeapon = "gun"; | |
break; | |
case 'whip'; | |
$indyWeapon = "fists"; | |
break; | |
case 'gun'; | |
$indyWeapon = "whip"; | |
break; | |
} | |
echo $indyWeapon; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment