Advertisement
qcarpentier

Pokemon loop

Nov 14th, 2019
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. program loop;
  2.  
  3. {$APPTYPE CONSOLE}
  4.  
  5. uses
  6. SysUtils, Crt32;
  7.  
  8. var capture, pokeball, continue: byte;
  9. var pikachuCounter, totalPokeballs: integer;
  10.  
  11. begin
  12. // Init
  13. pikachuCounter := 0;
  14. totalPokeballs := 0;
  15.  
  16. TextColor(10);
  17.  
  18. writeln('Pokemon Platine');
  19. writeln;
  20.  
  21. repeat
  22.  
  23. writeln('Un Pikachu sauvage apparait!');
  24. writeln('Voulez-vous le capturer?');
  25. writeln('1. Oui - 2. Non');
  26. readln(capture);
  27.  
  28. if (capture = 1) then
  29. begin
  30. writeln('Combien de pokeballs avez-vous utilise?');
  31. readln(pokeball);
  32.  
  33. writeln('Vous avez utilise ', pokeball, ' pokeballs pour capturer le Pikachu!');
  34. // Compteur de Pikachu
  35. pikachuCounter := pikachuCounter + 1;
  36. // Nombre total de Pokeballs utilisées pour capturer
  37. totalPokeballs := totalPokeballs + pokeball;
  38. end;
  39.  
  40. if (capture = 2) then
  41. begin
  42. writeln('Vous prenez la fuite!');
  43. end;
  44.  
  45. writeln('Voulez-vous continuer?');
  46. writeln('1. Oui - 2. Non');
  47. readln(continue);
  48.  
  49. // Clear Screen
  50. ClrScr;
  51.  
  52. until (continue = 2);
  53.  
  54. writeln('Vous avez utilise ', totalPokeballs, ' pokeballs pour capturer ', pikachuCounter, ' Pikachu!');
  55. writeln('Appuyez sur [Entree] pour continuer...');
  56. readln;
  57. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement