Seven Game

Two players play the Seven game. Each one throws a pair of dice on the
table and scores the sum of the obtained values. A player wins when his
score does not exceed seven and it is either closer to seven than the
rival’s score or the rival’s score exceeds seven. Note that there are
cases where no player wins. Write a function @winner(p, q, r, s)@ that
given the dice values p and q got by the first player and r and s got by
the second player returns integer 1 if the winner is the first player,
returns 2 when the winner is the second player and returns integer 0
when there is no winner. Dice values p, q, r and s are integers greater
than zero and less that seven

Sample session

Problem information

Author: ProAl

Generation: 2026-01-25T16:32:57.630Z

© Jutge.org, 2006–2026.
https://jutge.org
