#include #include #include #include #include #pragma warning(disable: 4996) enum GameMode { ROLL_MODE, FIX_MODE, SCORE_MODE }; enum Scores { }; typedef struct ranking { int rank; char name[10]; int score; }ranking; void hideCursor(); //커서 숨김 void gotoxy(int x, int y); //좌표이동함수 void displayDice(int* eyes, int s); //주사위 모양 출력(3단으로 나눠서 출력) void displayTop(int* eyes, int s); //주사위 위 출력 void displayMid(int* eyes, int s); // 주사위 중간 출력 void displayBot(int* eyes, int s); //주사위 아래 출력 int displayStart(int* eyes, int s); //메인화면 void displayRanking(ranking* r); //랭킹 시스템 확인 void jump();//??? void rollDice(int* eyes, int s, int* fix); //주사위 굴리기 void clearScreen(); //화면 정리 void displayScoreBoard(); //오른쪽 스코어보드 출력 void displaySelectScore(int selectScore, int player); //스코어보드 선택 void displayRoll(int mode, int turn); //굴리기 출력 void displaySelectFix(int mode, int fixNum); //주사위 고정 출력 void displayScores(int player, int playersScore[][12], int selected[][12], int scores[], int remainRoll, int eyesCount[], int sumEyes); //창에 값 출력 int main() { clearScreen(); ranking r[10] = { 0 }; int rCount = 0; FILE* fp; if (!(fp = fopen("D:\\천호영CWorkspace\\YachtDice\\Ranking.txt", "a+"))) { printf("파일 연결 실패\n\n"); return 0; } while (fscanf(fp, "%d\t%s\t%d", &r[rCount].rank, r[rCount].name, &r[rCount].score) == 3) { rCount++; } fclose(fp); int isStart = 0; HANDLE hInput = GetStdHandle(STD_INPUT_HANDLE); DWORD prev_mode; GetConsoleMode(hInput, &prev_mode); DWORD new_mode = prev_mode; new_mode &= ~ENABLE_QUICK_EDIT_MODE; // Quick Edit 모드 끄기 (드래그 반전 방지) new_mode |= ENABLE_EXTENDED_FLAGS; // Quick Edit 제어에 필요 new_mode |= ENABLE_MOUSE_INPUT; // 마우스 드래그 차단 SetConsoleMode(hInput, new_mode); SetConsoleTitle(L"Yacht Dice"); hideCursor(); srand((unsigned int)time(NULL)); int eyes[5]; //주사위 눈 담는배열 for (int i = 0; i < 5; i++) eyes[i] = i + 1; int fixNum = 0; //고정한 주사위 수 int fix[5] = { 0 }; //고정한 수 담는 배열 int selectScore = -1; int mode = 0; int key; int player = 0; int playersScore[2][12] = { 0 }; int selected[2][12] = { 0 }; int remainRoll = 3; int turn = 1; int players = 0; while (!players) { players = displayStart(eyes, isStart); if (players == 0) displayRanking(r); } isStart = 1; clearScreen(); if (players == 1) { while (1) { int eyesCount[6] = { 0 }; // 각 눈이 몇 개인지 저장하는 배열. int sumEyes = 0; for (int i = 0; i < 5; i++) { eyesCount[eyes[i] - 1]++; sumEyes += eyes[i]; } int scores[12] = { 0 }; gotoxy(0, 0); gotoxy(65, 3); printf("turn %2d/12", turn); gotoxy(27, 8); printf("SINGLE MODE"); printf("\n\n\n\t"); for (int i = 0; i < 5; i++) { if (fix[i] == 0) printf(" "); else printf(" fix "); } puts(""); displayDice(eyes, isStart); displaySelectFix(mode, fixNum); displayRoll(mode, turn); gotoxy(25, 22); printf("Remain Roll : %d", remainRoll); displayScoreBoard(); int p1SubTotal = 0; for (int i = 0; i < 6; i++) { p1SubTotal += playersScore[0][i]; } int p2SubTotal = 0; for (int i = 0; i < 6; i++) { p2SubTotal += playersScore[1][i]; } int p1Total = 0; for (int i = 0; i < 12; i++) { p1Total += playersScore[0][i]; } int p2Total = 0; for (int i = 0; i < 12; i++) { p2Total += playersScore[1][i]; } displaySelectScore(selectScore, player); for (int i = 0; i < 6; i++) { scores[i] = eyesCount[i] * (i + 1); } scores[6] = sumEyes; for (int i = 0; i < 6; i++) { if (eyesCount[i] >= 4) { scores[7] = sumEyes; break; } } int isFullHouse = 0; for (int i = 0; i < 6; i++) { if (eyesCount[i] == 3 || eyesCount[i] == 2 || eyesCount[i] == 5) { isFullHouse += eyesCount[i]; } if (isFullHouse == 5) { scores[8] = sumEyes; break; } } for (int i = 0; i < 3; i++) { int isSS = 0; for (int j = 0; j < 4; j++) { if (eyesCount[i + j] == 0) break; if (j == 3) isSS = 1; } if (isSS) { scores[9] = 15; break; } } for (int i = 0; i < 2; i++) { int isLS = 0; for (int j = 0; j < 5; j++) { if (eyesCount[i + j] == 0) break; if (j == 4) isLS = 1; } if (isLS) { scores[10] = 30; break; } } for (int i = 0; i < 6; i++) { if (eyesCount[i] == 5) { scores[11] = 50; break; } } displayScores(player, playersScore, selected, scores, remainRoll, eyesCount, sumEyes); gotoxy(82, 12); //Subtotal printf("%2d/63", p1SubTotal); gotoxy(83, 13); //+35 Bonus if (p1SubTotal >= 63) { p1Total += 35; printf("+35"); } gotoxy(83, 25); //Total printf("%3d", p1Total); if (turn == 13) { rCount = 0; if (!(fp = fopen("D:\\천호영CWorkspace\\YachtDice\\Ranking.txt", "a+"))) { printf("파일 연결 실패\n\n"); return 0; } while (fscanf(fp, "%d\t%s\t%d", &r[rCount].rank, r[rCount].name, &r[rCount].score) == 3) { rCount++; } fclose(fp); char name[10] = { 0 }; gotoxy(19, 25); printf("게임 끝! 이름 입력: "); scanf("%s", name); if (!(fp = fopen("D:\\천호영CWorkspace\\YachtDice\\Ranking.txt", "w"))) { printf("\t\t파일 연결 실패"); return 0; } int rCount = 0; for (int i = 0; i < 10; i++) { if (p1Total <= r[rCount].score) { fprintf(fp, "%d\t%s\t%d\n", i + 1, r[rCount].name, r[rCount].score); rCount++; } else { fprintf(fp, "%d\t%s\t%d\n", i + 1, name, p1Total); p1Total = -1; } } gotoxy(23, 27); printf("PRESS ENTER TO EXIT"); key = _getch(); if (key == 13 || key == 32) break; } if (_kbhit()) { key = _getch(); if (key == 224) // 방향키 { key = _getch(); if (key == 77) // 우 { if (mode == ROLL_MODE && remainRoll != 3) // ROLL > SCORE { mode = SCORE_MODE; selectScore = 0; } else if (mode == FIX_MODE) // 고정할 주사위 선택 { if (fixNum < 4) { fixNum++; } } } else if (key == 75) // 좌 { if (mode == FIX_MODE) // 고정할 주사위 선택 { if (fixNum > 0) { fixNum--; } } else if (mode == SCORE_MODE) // SCORE > ROLL { if (remainRoll != 0) { mode = ROLL_MODE; selectScore = -1; } } } else if (key == 72) // 상 { if (mode == ROLL_MODE && remainRoll != 3) // ROLL > FIX { mode = FIX_MODE; } else if (mode == SCORE_MODE) // 점수 선택 if (selectScore > 0) { selectScore--; } } else if (key == 80) // 하 { if (mode == FIX_MODE) // FIX > ROLL { mode = ROLL_MODE; fixNum = 0; } else if (mode == SCORE_MODE) // 점수 선택 { if (selectScore < 11) { selectScore++; } } } } else if (key == 13 || key == 32) // 엔터 or 스페이스바 { if (mode == ROLL_MODE) // ROLL이면 주사위 굴리고 남은 횟수 -1 { rollDice(eyes, isStart, fix); remainRoll--; if (remainRoll == 0) // 남은 횟수가 0이면 SCORE로 이동 { mode = SCORE_MODE; selectScore = 0; } } else if (mode == FIX_MODE) // 주사위 고정 { if (fix[fixNum] == 0) { fix[fixNum] = 1; } else if (fix[fixNum] == 1) { fix[fixNum] = 0; } } else if (mode == SCORE_MODE) // 점수 고정하고 ROLL로 이동 { if (!selected[player][selectScore]) { selected[player][selectScore] = 1; playersScore[player][selectScore] = scores[selectScore]; for (int i = 0; i < 5; i++) { fix[i] = 0; } if (turn <= 12) remainRoll = 3; mode = ROLL_MODE; selectScore = -1; if (turn <= 12) { turn++; } } } } } } return 0; } if(players == 2) { while (1) { int eyesCount[6] = { 0 }; // 각 눈이 몇 개인지 저장하는 배열. int sumEyes = 0; for (int i = 0; i < 5; i++) { eyesCount[eyes[i] - 1]++; sumEyes += eyes[i]; } int scores[12] = { 0 }; gotoxy(0, 0); gotoxy(65, 3); printf("turn %2d/12", turn); gotoxy(84, 2); printf("1P\t\t2P"); gotoxy(28, 8); printf("%dP's turn", player + 1); printf("\n\n\n\t"); for (int i = 0; i < 5; i++) { if (fix[i] == 0) printf(" "); else printf(" fix "); } puts(""); displayDice(eyes, isStart); displaySelectFix(mode, fixNum); displayRoll(mode, turn); gotoxy(25, 22); printf("Remain Roll : %d", remainRoll); displayScoreBoard(); int p1SubTotal = 0; for (int i = 0; i < 6; i++) { p1SubTotal += playersScore[0][i]; } int p2SubTotal = 0; for (int i = 0; i < 6; i++) { p2SubTotal += playersScore[1][i]; } int p1Total = 0; for (int i = 0; i < 12; i++) { p1Total += playersScore[0][i]; } int p2Total = 0; for (int i = 0; i < 12; i++) { p2Total += playersScore[1][i]; } displaySelectScore(selectScore, player); for (int i = 0; i < 6; i++) { scores[i] = eyesCount[i] * (i + 1); } scores[6] = sumEyes; for (int i = 0; i < 6; i++) { if (eyesCount[i] >= 4) { scores[7] = sumEyes; break; } } int isFullHouse = 0; for (int i = 0; i < 6; i++) { if (eyesCount[i] == 3 || eyesCount[i] == 2 || eyesCount[i] == 5) { isFullHouse += eyesCount[i]; } if (isFullHouse == 5) { scores[8] = sumEyes; break; } } for (int i = 0; i < 3; i++) { int isSS = 0; for (int j = 0; j < 4; j++) { if (eyesCount[i + j] == 0) break; if (j == 3) isSS = 1; } if (isSS) { scores[9] = 15; break; } } for (int i = 0; i < 2; i++) { int isLS = 0; for (int j = 0; j < 5; j++) { if (eyesCount[i + j] == 0) break; if (j == 4) isLS = 1; } if (isLS) { scores[10] = 30; break; } } for (int i = 0; i < 6; i++) { if (eyesCount[i] == 5) { scores[11] = 50; break; } } displayScores(player, playersScore, selected, scores, remainRoll, eyesCount, sumEyes); gotoxy(82, 12); //Subtotal printf("%2d/63", p1SubTotal); gotoxy(94, 12); printf("%2d/63", p2SubTotal); gotoxy(83, 13); //+35 Bonus if (p1SubTotal >= 63) { p1Total += 35; printf("+35"); } gotoxy(95, 13); if (p2SubTotal >= 63) { p2SubTotal += 35; printf("+35"); } gotoxy(83, 25); //Total printf("%3d", p1Total); gotoxy(95, 25); printf("%3d", p2Total); if (turn == 13) { gotoxy(50, 27); int winner; if (p1Total > p2Total) printf("1P WIN!\n"); else if (p1Total < p2Total) printf("2P WIN!\n"); else printf("DRAW...\n"); _getch(); break; } if (_kbhit()) { key = _getch(); if (key == 224) // 방향키 { key = _getch(); if (key == 77) // 우 { if (mode == ROLL_MODE && remainRoll != 3) // ROLL > SCORE { mode = SCORE_MODE; selectScore = 0; } else if (mode == FIX_MODE) // 고정할 주사위 선택 { if (fixNum < 4) { fixNum++; } } } else if (key == 75) // 좌 { if (mode == FIX_MODE) // 고정할 주사위 선택 { if (fixNum > 0) { fixNum--; } } else if (mode == SCORE_MODE) // SCORE > ROLL { if (remainRoll != 0) { mode = ROLL_MODE; selectScore = -1; } } } else if (key == 72) // 상 { if (mode == ROLL_MODE && remainRoll != 3) // ROLL > FIX { mode = FIX_MODE; } else if (mode == SCORE_MODE) // 점수 선택 if (selectScore > 0) { selectScore--; } } else if (key == 80) // 하 { if (mode == FIX_MODE) // FIX > ROLL { mode = ROLL_MODE; fixNum = 0; } else if (mode == SCORE_MODE) // 점수 선택 { if (selectScore < 11) { selectScore++; } } } } else if (key == 13 || key == 32) // 엔터 or 스페이스바 { if (mode == ROLL_MODE) // ROLL이면 주사위 굴리고 남은 횟수 -1 { rollDice(eyes, isStart, fix); remainRoll--; if (remainRoll == 0) // 남은 횟수가 0이면 SCORE로 이동 { mode = SCORE_MODE; selectScore = 0; } } else if (mode == FIX_MODE) // 주사위 고정 { if (fix[fixNum] == 0) { fix[fixNum] = 1; } else if (fix[fixNum] == 1) { fix[fixNum] = 0; } } else if (mode == SCORE_MODE) // 점수 고정하고 ROLL로 이동 { if (!selected[player][selectScore]) { selected[player][selectScore] = 1; playersScore[player][selectScore] = scores[selectScore]; for (int i = 0; i < 5; i++) { fix[i] = 0; } if (turn <= 12) remainRoll = 3; mode = ROLL_MODE; selectScore = -1; if (player == 0) player = 1; else { if (turn <= 12) { turn++; player = 0; } } } } } } } return 0; } } void gotoxy(int x, int y) { COORD pos; pos.X = x; pos.Y = y; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos); } void hideCursor() { HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_CURSOR_INFO info; info.dwSize = 100; info.bVisible = FALSE; SetConsoleCursorInfo(consoleHandle, &info); } void displayDice(int* eyes, int s) { if (!s) jump(); else printf("\t"); printf("┏━━━━━━━┓ ┏━━━━━━━┓ ┏━━━━━━━┓ ┏━━━━━━━┓ ┏━━━━━━━┓\n"); displayTop(eyes, s); displayMid(eyes, s); displayBot(eyes, s); if (!s) jump(); else printf("\t"); printf("┗━━━━━━━┛ ┗━━━━━━━┛ ┗━━━━━━━┛ ┗━━━━━━━┛ ┗━━━━━━━┛\n"); } void displayTop(int* eyes, int s) { if (!s) jump(); else printf("\t"); for (int i = 0; i < 5; i++) { switch (eyes[i]) { case 1: printf("┃    ┃ "); break; case 2: printf("┃ ●   ┃ "); break; case 3: printf("┃ ●   ┃ "); break; case 4: printf("┃ ●  ● ┃ "); break; case 5: printf("┃ ●  ● ┃ "); break; case 6: printf("┃ ●  ● ┃ "); } } puts(""); } void displayMid(int* eyes, int s) { if (!s) jump(); else printf("\t"); for (int i = 0; i < 5; i++) { switch (eyes[i]) { case 1: printf("┃  ●  ┃ "); break; case 2: printf("┃    ┃ "); break; case 3: printf("┃  ●  ┃ "); break; case 4: printf("┃    ┃ "); break; case 5: printf("┃  ●  ┃ "); break; case 6: printf("┃ ●  ● ┃ "); } } puts(""); } void displayBot(int* eyes, int s) { if (!s) jump(); else printf("\t"); for (int i = 0; i < 5; i++) { switch (eyes[i]) { case 1: printf("┃    ┃ "); break; case 2: printf("┃   ● ┃ "); break; case 3: printf("┃   ● ┃ "); break; case 4: printf("┃ ●  ● ┃ "); break; case 5: printf("┃ ●  ● ┃ "); break; case 6: printf("┃ ●  ● ┃ "); } } puts(""); } int displayStart(int* eyes, int s) { int key; int startSelect = 1; while (1) { gotoxy(0, 0); printf("\n\n\n\n\n\n\n\n\t\t\t\t\t\t Yacht Dice\n\n"); displayDice(eyes, s); if (startSelect == 1) printf("\n\n\n\t\t\t\t\t -> SINGLE MULTI RANKING"); else if (startSelect == 2) printf("\n\n\n\t\t\t\t\t SINGLE -> MULTI RANKING"); else if (startSelect == 0) printf("\n\n\n\t\t\t\t\t SINGLE MULTI -> RANKING"); if (_kbhit()) { key = _getch(); if (key == 13 || key == 32) //13 = 엔터, 32 = 스페이스바 { return startSelect; break; } else if (key == 224) //224 = 방향키 입력을 받을려면 1차 조건으로 224를 걸고 키 입력을 받음 { key = _getch(); if (key == 75) //왼쪽 키 { if (startSelect == 2) startSelect = 1; else if (startSelect == 0) startSelect = 2; } else if (key == 77) //오른쪽 키 { if (startSelect == 1) startSelect = 2; else if (startSelect == 2) startSelect = 0; } } } } } void displayRanking(ranking* r) { clearScreen(); int key; while(1) { gotoxy(0, 3); for (int i = 0; i < 10; i++) { if (r[i].rank == 0) break; printf("\t\t\t\t\t\t%2d %10s %3d\n\n", r[i].rank, r[i].name, r[i].score); } gotoxy(0, 25); printf("\t\t\t\t\t\tPRESS ENTER TO RETURN"); if (_kbhit()) { key = _getch(); if (key == 13 || key == 32) { clearScreen(); break; } } } } void jump() { printf("\t\t\t\t "); } void rollDice(int* eyes, int s, int* fix) { for (int i = 0; i < 5; i++) { gotoxy(0, 0); for (int j = 0; j < 5; j++) { if (fix[j] == 0) eyes[j] = rand() % 6 + 1; } printf("\n\n\n\n\n\n\n\n\n\n\n\n"); displayDice(eyes, s); Sleep(100); } } void clearScreen() { HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_SCREEN_BUFFER_INFO csbi; DWORD count; DWORD cellCount; COORD homeCoords = { 0, 0 }; if (hConsole == INVALID_HANDLE_VALUE) return; // 현재 콘솔 정보 가져오기 if (!GetConsoleScreenBufferInfo(hConsole, &csbi)) return; cellCount = csbi.dwSize.X * csbi.dwSize.Y; // 화면 지우기 FillConsoleOutputCharacter(hConsole, ' ', cellCount, homeCoords, &count); FillConsoleOutputAttribute(hConsole, csbi.wAttributes, cellCount, homeCoords, &count); // 커서 위치를 (0,0)으로 SetConsoleCursorPosition(hConsole, homeCoords); } void displayScoreBoard() { gotoxy(65, 5); printf("Aces"); gotoxy(65, 6); printf("Deuces"); gotoxy(65, 7); printf("Threes"); gotoxy(65, 8); printf("Fours"); gotoxy(65, 9); printf("Fives"); gotoxy(65, 10); printf("Sixes"); gotoxy(65, 12); printf("Subtotal"); gotoxy(65, 13); printf("+35 Bonus"); gotoxy(65, 15); printf("Bonus if Aces-Sixes are over 63 points"); gotoxy(65, 17); printf("Choice"); gotoxy(65, 19); printf("4 of a Kind"); gotoxy(65, 20); printf("Full House"); gotoxy(65, 21); printf("S. Straight"); gotoxy(65, 22); printf("L. Straight"); gotoxy(65, 23); printf("Yacht"); gotoxy(65, 25); printf("Total"); } void displaySelectScore(int selectScore, int player) { gotoxy(79, 5); if (selectScore == 0 && player == 0) { printf("->"); } else { printf(" "); } gotoxy(79, 6); if (selectScore == 1 && player == 0) { printf("->"); } else { printf(" "); } gotoxy(79, 7); if (selectScore == 2 && player == 0) { printf("->"); } else { printf(" "); } gotoxy(79, 8); if (selectScore == 3 && player == 0) { printf("->"); } else { printf(" "); } gotoxy(79, 9); if (selectScore == 4 && player == 0) { printf("->"); } else { printf(" "); } gotoxy(79, 10); if (selectScore == 5 && player == 0) { printf("->"); } else { printf(" "); } gotoxy(79, 17); if (selectScore == 6 && player == 0) { printf("->"); } else { printf(" "); } gotoxy(79, 19); if (selectScore == 7 && player == 0) { printf("->"); } else { printf(" "); } gotoxy(79, 20); if (selectScore == 8 && player == 0) { printf("->"); } else { printf(" "); } gotoxy(79, 21); if (selectScore == 9 && player == 0) { printf("->"); } else { printf(" "); } gotoxy(79, 22); if (selectScore == 10 && player == 0) { printf("->"); } else { printf(" "); } gotoxy(79, 23); if (selectScore == 11 && player == 0) { printf("->"); } else { printf(" "); } gotoxy(91, 5); if (selectScore == 0 && player == 1) { printf("->"); } else { printf(" "); } gotoxy(91, 6); if (selectScore == 1 && player == 1) { printf("->"); } else { printf(" "); } gotoxy(91, 7); if (selectScore == 2 && player == 1) { printf("->"); } else { printf(" "); } gotoxy(91, 8); if (selectScore == 3 && player == 1) { printf("->"); } else { printf(" "); } gotoxy(91, 9); if (selectScore == 4 && player == 1) { printf("->"); } else { printf(" "); } gotoxy(91, 10); if (selectScore == 5 && player == 1) { printf("->"); } else { printf(" "); } gotoxy(91, 17); if (selectScore == 6 && player == 1) { printf("->"); } else { printf(" "); } gotoxy(91, 19); if (selectScore == 7 && player == 1) { printf("->"); } else { printf(" "); } gotoxy(91, 20); if (selectScore == 8 && player == 1) { printf("->"); } else { printf(" "); } gotoxy(91, 21); if (selectScore == 9 && player == 1) { printf("->"); } else { printf(" "); } gotoxy(91, 22); if (selectScore == 10 && player == 1) { printf("->"); } else { printf(" "); } gotoxy(91, 23); if (selectScore == 11 && player == 1) { printf("->"); } else { printf(" "); } } void displayRoll(int mode, int turn) { gotoxy(28, 19); if (mode == ROLL_MODE && turn <= 12) printf("-> roll"); else printf(" roll"); } void displaySelectFix(int mode, int fixNum) { gotoxy(12, 17); if (mode == FIX_MODE) { if (fixNum == 0) printf("↑ "); else if (fixNum == 1) printf(" ↑ "); else if (fixNum == 2) printf(" ↑ "); else if (fixNum == 3) printf(" ↑ "); else if (fixNum == 4) printf(" ↑"); } else printf(" "); } void displayScores(int player, int playersScore[][12], int selected[][12], int scores[], int remainRoll, int eyesCount[], int sumEyes) { gotoxy(83, 5); //Aces if (!selected[0][0]) if (remainRoll == 3 || player == 1) printf(" "); else printf("%3d", scores[0]); else printf("[%2d]", playersScore[0][0]); gotoxy(95, 5); if (!selected[1][0]) if (remainRoll == 3 || player == 0) printf(" "); else printf("%3d", scores[0]); else printf("[%2d]", playersScore[1][0]); gotoxy(83, 6); //Dueces if (!selected[0][1]) if (remainRoll == 3 || player == 1) printf(" "); else printf("%3d", scores[1]); else printf("[%2d]", playersScore[0][1]); gotoxy(95, 6); if (!selected[1][1]) if (remainRoll == 3 || player == 0) printf(" "); else printf("%3d", scores[1]); else printf("[%2d]", playersScore[1][1]); gotoxy(83, 7); //Threes if (!selected[0][2]) if (remainRoll == 3 || player == 1) printf(" "); else printf("%3d", scores[2]); else printf("[%2d]", playersScore[0][2]); gotoxy(95, 7); if (!selected[1][2]) if (remainRoll == 3 || player == 0) printf(" "); else printf("%3d", scores[2]); else printf("[%2d]", playersScore[1][2]); gotoxy(83, 8); //Fours if (!selected[0][3]) if (remainRoll == 3 || player == 1) printf(" "); else printf("%3d", scores[3]); else printf("[%2d]", playersScore[0][3]); gotoxy(95, 8); if (!selected[1][3]) if (remainRoll == 3 || player == 0) printf(" "); else printf("%3d", scores[3]); else printf("[%2d]", playersScore[1][3]); gotoxy(83, 9); //Fives if (!selected[0][4]) if (remainRoll == 3 || player == 1) printf(" "); else printf("%3d", scores[4]); else printf("[%2d]", playersScore[0][4]); gotoxy(95, 9); if (!selected[1][4]) if (remainRoll == 3 || player == 0) printf(" "); else printf("%3d", scores[4]); else printf("[%2d]", playersScore[1][4]); gotoxy(83, 10); //Sixes if (!selected[0][5]) if (remainRoll == 3 || player == 1) printf(" "); else printf("%3d", scores[5]); else printf("[%2d]", playersScore[0][5]); gotoxy(95, 10); if (!selected[1][5]) if (remainRoll == 3 || player == 0) printf(" "); else printf("%3d", scores[5]); else printf("[%2d]", playersScore[1][5]); gotoxy(83, 17); //Choice if (!selected[0][6]) if (remainRoll == 3 || player == 1) printf(" "); else printf("%3d", scores[6]); else printf("[%2d]", playersScore[0][6]); gotoxy(95, 17); if (!selected[1][6]) if (remainRoll == 3 || player == 0) printf(" "); else printf("%3d", scores[6]); else printf("[%2d]", playersScore[1][6]); gotoxy(83, 19); //4 of a Kind if (!selected[0][7]) if (remainRoll == 3 || player == 1) printf(" "); else printf("%3d", scores[7]); else printf("[%2d]", playersScore[0][7]); gotoxy(95, 19); if (!selected[1][7]) if (remainRoll == 3 || player == 0) printf(" "); else printf("%3d", scores[7]); else printf("[%2d]", playersScore[1][7]); gotoxy(83, 20); //Full House if (!selected[0][8]) if (remainRoll == 3 || player == 1) printf(" "); else printf("%3d", scores[8]); else printf("[%2d]", playersScore[0][8]); gotoxy(95, 20); if (!selected[1][8]) if (remainRoll == 3 || player == 0) printf(" "); else printf("%3d", scores[8]); else printf("[%2d]", playersScore[1][8]); gotoxy(83, 21); //S. Straight if (!selected[0][9]) if (remainRoll == 3 || player == 1) printf(" "); else printf("%3d", scores[9]); else printf("[%2d]", playersScore[0][9]); gotoxy(95, 21); if (!selected[1][9]) if (remainRoll == 3 || player == 0) printf(" "); else printf("%3d", scores[9]); else printf("[%2d]", playersScore[1][9]); gotoxy(83, 22); //L. Straight if (!selected[0][10]) if (remainRoll == 3 || player == 1) printf(" "); else printf("%3d", scores[10]); else printf("[%2d]", playersScore[0][10]); gotoxy(95, 22); if (!selected[1][10]) if (remainRoll == 3 || player == 0) printf(" "); else printf("%3d", scores[10]); else printf("[%2d]", playersScore[1][10]); gotoxy(83, 23); //Yacht if (!selected[0][11]) if (remainRoll == 3 || player == 1) printf(" "); else printf("%3d", scores[11]); else printf("[%2d]", playersScore[0][11]); gotoxy(95, 23); if (!selected[1][11]) if (remainRoll == 3 || player == 0) printf(" "); else printf("%3d", scores[11]); else printf("[%2d]", playersScore[1][11]); }