Advertisement
fcamuso

Corso recupero C++ - video 28

Dec 8th, 2022
1,266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.09 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include "Dado.h"
  4.  
  5. using namespace std;
  6.  
  7. class Dado2 {
  8.  
  9. public:
  10.   Dado2() { num_facce = 6;}
  11.  
  12.   Dado2(int _num_facce)
  13.   {
  14.     if (_num_facce>0) { num_facce = _num_facce;}
  15.   }
  16.  
  17. private:
  18.   int num_facce = 0;
  19.   int valore = 0;  
  20.  
  21. };
  22.  
  23. int main()
  24. {
  25. //  Test test1 = Test();
  26. //
  27.   Dado2 d = Dado2();
  28. //
  29. //  cout << d.getNumFacce() << endl;
  30. //
  31. //
  32.  
  33.   Dado2 d2 = Dado2(20);
  34. //  //cout << d.get_valore() << endl;
  35. //
  36. //  for (int i=0; i<10; i++)
  37. //    cout << d.lancio() << endl;
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66. //  Dado tanti_dadi[20];
  67. //  for (int i=0; i<20; i++)
  68. //  {
  69. //    tanti_dadi[i] = Dado(12);
  70. //    cout << tanti_dadi[i].lancio() << endl;
  71. //  }
  72.   return 0;
  73.  
  74.  
  75. //    Dado d1 = Dado(); //creo dado a 6 facce
  76. //    cout << d1.lancio() << endl;
  77. //
  78. //
  79. //    cout << d1.get_valore() << endl;
  80. //
  81. //    Dado d2(6);
  82. //    cout << d2.lancio() << endl;
  83. //    cout << d2.get_valore() << endl;
  84. //
  85. //    Dado d3(20);
  86. //    cout << d3.lancio() << endl;
  87. //    cout << d3.get_valore() << endl;
  88.  
  89.     return 0;
  90. }
  91.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement