Skip to content

Instantly share code, notes, and snippets.

@brunopedroso
Created September 7, 2009 19:16
Show Gist options
  • Save brunopedroso/182523 to your computer and use it in GitHub Desktop.
Save brunopedroso/182523 to your computer and use it in GitHub Desktop.
for(i = 0;i < tamanho;i++){
if(i+1 < tamanho && (arrayJogadas[i] + arrayJogadas[i + 1] == 10)){
if (i+2 >= tamanho) {
return -1;
} else {
resultado += arrayJogadas[i] + arrayJogadas[i + 1] + arrayJogadas[i + 2];
i++;
}
} else {
resultado += arrayJogadas[i];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment