Skip to content
Browse files

Added check for Tie

  • Loading branch information...
1 parent 9a68eea commit 107e591c943100a96c27b6c21ebc1605c27bd27f @girving committed
Showing with 4 additions and 1 deletion.
  1. +4 −1 kalah.cilk
View
5 kalah.cilk
@@ -111,7 +111,10 @@ cilk int main(int argc, char **argv) {
}
if (game) {
- printf("Winner: s %d, r %d\n",p.w,a_rate(p,p.w));
+ if (!a_rate(p,p.w))
+ printf("Tie.\n");
+ else
+ printf("Winner: s %d, r %d\n",p.w,a_rate(p,p.w));
*m-- = 0;
if (*m == '-')
*m = 0;

0 comments on commit 107e591

Please sign in to comment.
Something went wrong with that request. Please try again.