SHARE
TWEET

Untitled

a guest Oct 10th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $weapons = ['fists', 'whip', 'gun'];
  4. $opponentWeapon = $weapons[rand(0, 2)]; // Cela permet de choisir une arme de manière aléatoire.
  5.  
  6. switch ($opponentWeapon) {
  7.     case 'fists':
  8.         $indyWeapon = $weapons[2];
  9.         break;
  10.     case 'whip':
  11.         $indyWeapon = $weapons[0];
  12.         break;
  13.     case 'gun':
  14.         $indyWeapon = $weapons[1];
  15.         break;
  16. }
  17.  
  18. echo "The opponent weapon is : " . $opponentWeapon . ", Indy weapon is : " . $indyWeapon . ".";
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top