
#include <stdio.h>

/* odds and score of 2d6 */

/*                0 1   2   3   4   5   6    7   8   9  10   11 12 */
int odds[] =   {  0,0,  1,  2,  3,  4,  5,   6,  5,  4,  3,   2, 1 };
int scores[] = {  0,0, 10, 10, 40, 40, 40, -10, 40, 40, 40, -10, 0 };
int possibilities = 36;

int main(void)
{
	int score = 0;
	int roll;
	for(;;)
	{
		fputs( "------input roll: ", stdout);
		if(1 == scanf("%d", &roll))	/* does read of number succeed? */
		{
			int score_change = scores[roll];
			printf("odds of roll: %d/%d\n", odds[roll], possibilities);
			printf("result of roll: %d\n", score_change);
			score += score_change;
			printf("updated score: %d\n", score);
		}
		else
		{
			puts("quitting");
			break;
		}
	}
	return 0;
}

