Skip to content

Instantly share code, notes, and snippets.

@creyn

creyn/index.js Secret

Created May 19, 2018 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save creyn/df50d6e13ee548680a2468ff28fce26c to your computer and use it in GitHub Desktop.
Save creyn/df50d6e13ee548680a2468ff28fce26c to your computer and use it in GitHub Desktop.
Droga Programisty : Szybkie Palce : funkcja CzyKtosOszukiwal
// Funkcja sprawdzajaca czy ktorys z graczy nie oszukiwal
function CzyKtosOszukiwal() {
if(licznikNacisniecGracz1 > limitNacisniec && licznikNacisniecGracz2 > limitNacisniec){
Oszust('Obaj Gracze oszukiwali. Nikt nie wygrywa!');
return true;
}
if(licznikNacisniecGracz1 > limitNacisniec) {
Oszust('Gracz nr 1 oszukiwał. Wygrywa Gracz nr 2!');
return true;
}
if(licznikNacisniecGracz2 > limitNacisniec) {
Oszust('Gracz nr 2 oszukiwał. Wygrywa Gracz nr 1!');
return true;
}
// nie znaleziono oszusta
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment