Skip to content

Instantly share code, notes, and snippets.

@metrafonic
Created October 26, 2014 13:08
Show Gist options
  • Save metrafonic/5cb7241494eb219e3d55 to your computer and use it in GitHub Desktop.
Save metrafonic/5cb7241494eb219e3d55 to your computer and use it in GitHub Desktop.
ispair
int isPair(int hand[]){
int i=0,brukteVerdier[13]={0}, antallpar=0, antalltress=0, kort=0;
for (i=0;i<5;i++){
kort = hand[i]%13;
if(brukteVerdier[kort]==1){
antallpar++;
}
if(brukteVerdier[kort]==2){
antalltress++;
}
brukteVerdier[kort]++;
}
if (antallpar==1 && antalltress==0){
return 1;
}else{
return 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment