Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $weapons = ['fists', 'whip', 'gun'];
- $opponentWeapon = $weapons[rand(0, 2)]; // Cela permet de choisir une arme de manière aléatoire.
- switch ($opponentWeapon) {
- case 'fists':
- $indyWeapon = $weapons[2];
- break;
- case 'whip':
- $indyWeapon = $weapons[0];
- break;
- case 'gun':
- $indyWeapon = $weapons[1];
- break;
- }
- echo "The opponent weapon is : " . $opponentWeapon . ", Indy weapon is : " . $indyWeapon . ".";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement