Advertisement
Guest User

Untitled

a guest
Oct 13th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. <?php
  2. $weapons = ['fists', 'whip', 'gun'];
  3. $opponentWeapon = $weapons[rand(0,2)];
  4. echo $opponentWeapon;
  5.  
  6. switch($opponentWeapon){
  7. case 'fists':
  8. echo ' '. 'bat le whip' . 'mais perd contre le gun' ;
  9. break;
  10.  
  11. case 'whip':
  12. echo ' '. 'bat le gun' . 'mais perd contre le fists' ;
  13. break;
  14.  
  15. case 'gun':
  16. echo ' '. 'bat le fists' . 'mais perd contre le whip' ;
  17. break;
  18. }
  19.  
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement