Advertisement
shulrak

ex1_3

Dec 20th, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. <?php  
  2. class Player {  
  3.  ...
  4. }
  5.  
  6. $myPlayer = New Player(4, 3);
  7.  
  8.  
  9.  
  10. $myPlayer2 = New Player(10, 20);
  11. myPlayer2->moveLeft();
  12. myPlayer2->moveLeft();
  13. myPlayer2->moveLeft();
  14. myPlayer2->moveUp();
  15. myPlayer2->printCoordinate();
  16.  
  17. ?>
  18.  
  19.  
  20.  
  21. Le code au dessus affichera dans l'ordre :
  22.  
  23. A player has been created to coordinate 4 and 3.
  24. A player has been created to coordinate 10 and 20.
  25. Current player coordinate is 7 and 21.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement