Skip to content

Instantly share code, notes, and snippets.

@svolpe43
Last active March 31, 2017 22:20
Show Gist options
  • Save svolpe43/8812898dc675b785517d48b0c6df3677 to your computer and use it in GitHub Desktop.
Save svolpe43/8812898dc675b785517d48b0c6df3677 to your computer and use it in GitHub Desktop.
void CardProcessor::FindBlankLengthAndIndex(Card *card) {
unsigned int i = 0;
unsigned int j = 0;
bool blankFound = false;
int blankLength = 0;
string buffer = card->GetStr();
for (i = 0; i < buffer.length(); i++) {
if(buffer[i] == '_'){
if(blankFound){
// do something different cause shit was already found
// card->SetBlankLength(0); or something
}else{
blankFound = true;
while(buffer[j] != ' '){
blankLength++;
j++;
}
}
}
}
if (blankLength < 3) {
card->SetBlankLength(0);
}
else {
card->SetBlankLength(blankLength);
card->SetBlankIndex(blankIndex);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment