Advertisement
payjack

acsl2

Dec 12th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.09 KB | None | 0 0
  1. //ACSL
  2. //Olivia Pagach
  3. //12-11-17
  4.  
  5. //stuff
  6. #include <iostream>
  7. #include <time.h>
  8. #include <stdlib.h>
  9. #include <iomanip>
  10. #include <fstream>
  11.  
  12. using namespace std;
  13.  
  14. //main thing
  15. int main ()
  16.  
  17. {
  18.     cout<<"Welcome to an overly complicated card game program..by Olivia Pagach. Sit back and relax, there is no user input! :D"<<endl;
  19. int i=0;
  20. int start=0;
  21. int total=0;
  22. char comma = ',';
  23. cout<<"ok"<<endl;
  24.  
  25. ifstream infile;
  26.  
  27. char cNum [11];
  28. int player1 [7];
  29. int player2 [4];
  30. int dealer [3];
  31.  
  32. cout<<"ok"<<endl;
  33.     ofstream outFile;
  34. cout<<"ok"<<endl;
  35. cout<<start<<endl;
  36. infile.open ("cardslol.txt", ifstream::in);
  37. if (infile.is_open())
  38.     {
  39.     while (infile.good())
  40.         {
  41.             infile.getline(cNum, 256, ',');
  42.             if (i==0)
  43.             {
  44.                 cout<<start;
  45.                 cout<<"b4startok"<<endl;
  46.                 start = atoi(cNum);
  47.                 cout<<"afterstartok"<<endl;
  48.                 cout<<start;
  49.  
  50.             else {
  51.             cout<<cards;
  52.             cout<<"b4cardsok"<<endl;
  53.             cards [i] =atoi(cNum);
  54.             cout<<"aftercardsok"<<endl;
  55.             cout<<cards;
  56.             }
  57.             }
  58.             i++;
  59.             return 0;
  60.             }
  61.  
  62. int game (int start, int cards [])
  63. {
  64.   int total=start; //total will begin at 87
  65.     for (i=1; i<=11; i++)
  66.       int total=total+cards[i]; //92=87+[1](5)
  67.                                 //total=92+[
  68.           if (total>99)
  69.           {
  70.             cout<<"After 4 rounds, the score is"<<total<<"the game is over.."<<endl;
  71.             if (i==[1,2,3,4,6,8,10])
  72.               {
  73.                 cout<<"The dealer is the winner"<<endl;
  74.                   else {
  75.                     cout<<"The player is the winner"<<endl;
  76.             }
  77.           }
  78.         }
  79.         i++;
  80.       }
  81.     }
  82. }
  83.  
  84.  
  85.  
  86. int game (int start, int cards [])
  87. {
  88.   do {
  89.     total=total=cards[1];
  90.     total=total=cards[5];
  91.  
  92.   } while(total<99);
  93. }
  94.   if(total>=99)
  95.   {
  96.     cout<<"The game is over, the ending score is..."<<total<<"The winner is..."<<endl;
  97.     if (i==[1 || 2 || 3 || 4 ||])
  98.  
  99.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement