Thread: The ultimate noob lol...plz help

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #13
    Registered User
    Join Date
    Nov 2005
    Posts
    5
    ok guys here is the program that i have...it is now technically Working...obv its not were i want it yet, but it'll get there over time.

    Code:
    #include <iostream>
    #include <cstdlib>
    #include <string>
    #include <cmath>
    
    using namespace std;
    
    int main(int argc, char *argv[])
    
    { 
    
      
      cout << "First Card, Ace(a) King(k) Queen(q) Jack(j) Ten(t) Nine(9) ect.. and Press Enter" << endl;
      
      char cardone;
      int resultoneA;
      int resultoneK;
      int resultoneQ;
      int resultoneJ;
      int resultoneT;
      int resultone9;
      int resultone8;
      int resultone7;
      int resultone6;
      int resultone5;
      int resultone4;
      int resultone3;
      int resultone2;  
      cin >> cardone;
      resultoneA = cardone == 'a' ? 16 : 0;
      resultoneK = cardone == 'k' ? 14 : 0;
      resultoneQ = cardone == 'q' ? 13 : 0; 
      resultoneJ = cardone == 'j' ? 12 : 0; 
      resultoneT = cardone == 't' ? 11 : 0; 
      resultone9 = cardone == '9' ? 9 : 0; 
      resultone8 = cardone == '8' ? 8 : 0; 
      resultone7 = cardone == '7' ? 7 : 0; 
      resultone6 = cardone == '6' ? 6 : 0; 
      resultone5 = cardone == '5' ? 5 : 0; 
      resultone4 = cardone == '4' ? 4 : 0; 
      resultone3 = cardone == '3' ? 3 : 0; 
      resultone2 = cardone == '2' ? 2 : 0; 
      
      cout << " " << endl;
      cout << "Second Card, Ace(a) King(k) Queen(q) Jack(j) Ten(t) Nine(9) ect.. and Press Enter" << endl;
      cout << " " << endl;
      
      char cardtwo;
      int resulttwoA;
      int resulttwoK;
      int resulttwoQ;
      int resulttwoJ;
      int resulttwoT;
      int resulttwo9;
      int resulttwo8;
      int resulttwo7;
      int resulttwo6;
      int resulttwo5;
      int resulttwo4;
      int resulttwo3;
      int resulttwo2;  
      cin >> cardtwo;
      resulttwoA = cardtwo == 'a' ? 16 : 0;
      resulttwoK = cardtwo == 'k' ? 14 : 0;
      resulttwoQ = cardtwo == 'q' ? 13 : 0; 
      resulttwoJ = cardtwo == 'j' ? 12 : 0; 
      resulttwoT = cardtwo == 't' ? 11 : 0; 
      resulttwo9 = cardtwo == '9' ? 9 : 0; 
      resulttwo8 = cardtwo == '8' ? 8 : 0; 
      resulttwo7 = cardtwo == '7' ? 7 : 0; 
      resulttwo6 = cardtwo == '6' ? 6 : 0; 
      resulttwo5 = cardtwo == '5' ? 5 : 0; 
      resulttwo4 = cardtwo == '4' ? 4 : 0; 
      resulttwo3 = cardtwo == '3' ? 3 : 0; 
      resulttwo2 = cardtwo == '2' ? 2 : 0; 
      
      cout << " " << endl;
      cout << "Are your cards Paired yes(y) no(n)?" << endl;
      cout << " " << endl;
        
      char paired;
      int pairedresult;
      cin >> paired;
      pairedresult = paired == 'y' ? 10 : 0;
      
      cout << " " << endl;    
      cout << "Are your cards Suited yes(y) no(n)?" << endl;
      cout << " " << endl;
      
      char suited;
      int suitedresult;
      cin >> suited;
      suitedresult = suited == 'y' ? 4 : 0;
      
      cout << " " << endl;
      cout << "Are your cards connected (ie, next to each other in rank as with J10 or JQ etc.) (y),(n)" << endl;
      cout << " " << endl;
      
      char gap1;
      int gap1result;
      cin >> gap1;
      gap1result = gap1 == 'y' ? 3 : 0;
     
      cout << " " << endl;
      cout << "Are your cards single \"gapped\" (ie, Q10 or J9 etc.) (y),(n)" << endl;
      cout << " " << endl;
      
      char gap2;
      int gap2result;
      cin >> gap2;
      gap2result = gap2 == 'y' ? 2 : 0;
      
      cout << " " << endl;
      cout << "Are your cards double \"gapped\" (ie, AJ or Q9 etc.) (y),(n)" << endl;
      cout << " " << endl;
      
      char gap3;
      int gap3result;
      cin >> gap3;
      gap3result = gap3 == 'y' ? 1 : 0;
      
      cout << " " << endl;
      cout << "Are you in late position? (y),(n)" << endl;
      cout << " " << endl;
      
      char position;
      int positionresult;
      cin >> position;
      positionresult = position == 'y' ? 4 :0;
      
      cout << " " << endl;
      cout << "Call a bet with 30 points or more, and raise or call a raise with 34 points or more." << endl;
      cout << " " << endl;
      
        cout << resultoneA + resultoneK + resultoneQ + resultoneJ + resultoneT +
              resultone9 + resultone8 + resultone7 + resultone6 + resultone5 +
              resultone4 + resultone3 + resultone2 + 
              resulttwoA + resulttwoK + resulttwoQ + resulttwoJ + resulttwoT +
              resulttwo9 + resulttwo8 + resulttwo7 + resulttwo6 + resulttwo5 +
              resulttwo4 + resulttwo3 + resulttwo2 +
              pairedresult + 
              suitedresult + 
              gap1result + 
              gap2result + 
              gap3result + 
              positionresult << endl;
              
      
    
     
      
      system( "PAUSE" );	
      return 0;
    }


    I'm trying to figure out how to get it to skip certain steps once a certain question has been answered...for example when it askes:

    cout << "Are your cards Paired yes(y) no(n)?" << endl;

    If the answer to this is yes i would like it to skip all of the other questions expect for the last one because the answer is obv going to be no for the rest...i tried doing this with a while loop and the program just wasn't havin it lol...any ideas would be appreciated.

    And thanks for all the help that has gotten me this far
    Last edited by thatpkrguy; 11-10-2005 at 04:00 PM. Reason: typo in code...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Please Help A Noob Here (plz Im Begging You)
    By bobbie18 in forum C Programming
    Replies: 97
    Last Post: 03-28-2008, 03:38 AM
  2. Complete C noob...and completely stuck lol
    By JST212 in forum C Programming
    Replies: 6
    Last Post: 03-02-2008, 10:54 AM
  3. plz help here, noob actually .D
    By BjoRn3n in forum C++ Programming
    Replies: 1
    Last Post: 03-07-2005, 03:04 PM
  4. noob: compiling error... plz help!
    By chosii in forum C Programming
    Replies: 2
    Last Post: 05-10-2002, 05:53 AM
  5. Lol!
    By no-one in forum A Brief History of Cprogramming.com
    Replies: 24
    Last Post: 02-11-2002, 12:29 PM