Advertisement
ssnr

Untitled

Oct 11th, 2015
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. #include "human.h"
  2. #include "elf.h"
  3. #include "cyberdemon.h"
  4. #include "balrog.h"
  5. #include <iostream>
  6. #include <ctime>
  7. #include <cstdlib>
  8.  
  9.  
  10.  
  11. using namespace std;
  12.  
  13.  
  14.  
  15. int main() {
  16. srand(time(0));
  17.  
  18. human h1;
  19. elf e1;
  20. cyberdemon c1;
  21. balrog b1;
  22.  
  23. human h(20, 30);
  24. elf e(40, 50);
  25. cyberdemon c(60, 70);
  26. balrog b(80, 90);
  27.  
  28.  
  29. cout << "default human strength/hitpoints: " << h1.getStrength() << "/" << h1.getHitpoints() << endl;
  30. cout << "default elf strength/hitpoints: " << e1.getStrength() << "/" << e1.getHitpoints() << endl;
  31. cout << "default cyberdemon strength/hitpoints: " << c1.getStrength() << "/" << c1.getHitpoints() << endl;
  32. cout << "default balrog strength/hitpoints: " << b1.getStrength() << "/" << b1.getHitpoints() << endl;
  33. cout << "non-default human strength/hitpoints: " << h.getStrength() << "/" << h.getHitpoints() << endl;
  34. cout << "non-default elf strength/hitpoints: " << e.getStrength() << "/" << e.getHitpoints() << endl;
  35. cout << "non-default cyberdemon strength/hitpoints: " << c.getStrength() << "/" << c.getHitpoints() << endl;
  36. cout << "non-default balrog strength/hitpoints: " << b.getStrength() << "/" << b.getHitpoints() << endl;
  37. cout << endl << endl;
  38.  
  39. cout << "Examples of " << h.getSpecies() << " damage: " << endl;
  40. for (int i = 0; i < 10; i++){
  41. int damage = h.getDamage();
  42. cout << " Total damage = " << damage << endl;
  43. cout << endl;
  44. }
  45. cout << endl;
  46.  
  47.  
  48.  
  49. cout << "Examples of " << e.getSpecies() << " damage: " << endl;
  50. for (int i = 0; i < 10; i++){
  51. int damage = e.getDamage();
  52. cout << " Total damage = " << damage << endl;
  53. cout << endl;
  54. }
  55. cout << endl;
  56.  
  57.  
  58.  
  59. cout << "Examples of " << c.getSpecies() << " damage: " << endl;
  60. for (int i = 0; i < 10; i++){
  61. int damage = c.getDamage();
  62. cout << " Total damage = " << damage << endl;
  63. cout << endl;
  64. }
  65. cout << endl;
  66.  
  67.  
  68.  
  69. cout << "Examples of " << b.getSpecies() << " damage: " << endl;
  70. for (int i = 0; i < 10; i++){
  71. int damage = b.getDamage();
  72. cout << " Total damage = " << damage << endl;
  73. cout << endl;
  74. }
  75. cout << endl;
  76.  
  77. system("pause");
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement