Guest User

proj1

a guest
May 21st, 2013
509
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.63 KB | None | 0 0
  1. HEADER:
  2.  
  3. #define SUITS_H
  4. #include <string>
  5. #include <iostream>
  6.  
  7. int rank [12] ; //declaration of array that holds value of card
  8. char suit [4] = (S,H,D,C) ; //declaration of array that holds type of card
  9.  
  10. int isroyalflush(char suit[4], int rank[5]) //procedure that tests
  11.     {
  12.         if(suit[0] != suit[1]) return 0; //the hand is a flush if the suit does not contain
  13.         if(suit[0] != suit[2]) return 0; // ..any other type of suit (I'm not sure if this is correct)
  14.         if(suit[0] != suit[3]) return 0; //
  15.        
  16.        
  17.         if(rank[0] = 13) return 0;
  18.         if(rank[1] = 12) return 0;
  19.         if(rank[2] = 11) return 0;
  20.         if(rank[3] = 10) return 0;
  21.         if(rank[4] = 1)  return 0;
  22.         return 1;
  23.     };
  24.  
  25. int isstraightflush //check for ordering in same suit
  26.  
  27. int fourofakind //check for same rank, of each suit
  28.  
  29. int fullhouse //check for three of same rank, irregardless of suit
  30.  
  31. int flush //check that all five cards are the same suit
  32.  
  33. int straight //check that rank is ordered, suit doesn't matter
  34.  
  35. int threeofakind //check for three cards with same rank
  36.  
  37. int twopair //check for pairs, check for consistencies in the pairs, suit doesn't matter
  38.  
  39. int onepair //check for two cards in hand with equal rank
  40.  
  41. int highcard //use if else, if none of above work, this is the option
  42.  
  43.  
  44. MAIN:
  45.  
  46. #include "suits.h"
  47. #include <string>
  48. #include <iostream>
  49.  
  50. using namespace std;
  51.  
  52. int main()
  53. {
  54.  
  55. };
  56.  
  57.  
  58. ERRORS:
  59.  
  60. proj1/suits.h:6:18: error: 'S' was not declared in this scope
  61. proj1/suits.h:6:20: error: 'H' was not declared in this scope
  62. proj1/suits.h:6:22: error: 'D' was not declared in this scope
  63. proj1/suits.h:6:24: error: 'C' was not declared in this scope
Advertisement
Add Comment
Please, Sign In to add comment