Created
October 26, 2014 13:08
-
-
Save metrafonic/5cb7241494eb219e3d55 to your computer and use it in GitHub Desktop.
ispair
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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