Quote:Original post by Bluseed
Well yah im not too far advanced and im using c++ i guess u can say im trying to figure this all out.
I know im running into a lot of questions myself knowing im doing some things wrong or the hard way, and nopw that you mention it , LOLOLOL , an array would be a lot better wouldnt it then i could just use a FOR statement. I was wondering how you would use a FOR statement with my code but i think that makes sense now. Trial and Error Trial and Error, thx for the tips and help appreciate it... im not totally noob, i use a lot of directX gfx, but really never got down and dirty into the logic portions which im trying to really dive into now.
1) put your cards in a vector; since these cards are numerical values, a vector of int should be enough
2) sort the vector
3) verify is you have a valid combination:
#include <vector>#include <algorithm>std::vector<int> hand;std::sort(hand.begin(), hand.end());bool straight = true;for (size_t i=1; i<hand.size(); i++) { if (hand != hand[i-1]+1) { straight = false; break; }}
BTW, I know that I'm rather impolite to ask, but can you try to write entire and correct words instead of painfull stuff like 'u' (you), 'im' (I'm) or 'i' (I)? English is not my mother tongue, thus I can have some problems to decipher posts that use such rather annoying AOL-style kind-of-English. Thanks a lot.