void GamePlay::thirdhand2() { Checks b; PlayerHandValue = 0; CpuHandValue = 0; result = ""; int x = 24; int y = 3; showc = true; shows = true; PressEnterToContinue = "Press Enter To Continue..."; Checks ck; Poker a; system("cls"); a.tablecards(deck, 10); a.createhand(hand, 25, 40); a.createtable(tablehand, 5, 17); // this will create the table, passing in the table hand, always pass in 5 and 7 for location Cards(); a.createtable(cpuhand, x, y);//creating the hands PlayerHandValue = ck.DetermineHand(PlayerValues, psuits);// determine the player hand storing value in PlayerHandValue CpuHandValue = ck.DetermineHand(cvalues, csuits);// determine the cpu hand storing value in CpuHandValue if (foldv) { PlayerHandValue = 0; } ck.determine(PlayerHandValue, CpuHandValue); if (showc) { chand = chand; } if (shows) { PressEnterToContinue = PressEnterToContinue; } if (!foldc) { fold = " "; } if (foldc == true) { //fold = "YOU LOSE!"; } Text(); // method to display the text on screen cout << chand; cin.get(); g = 0; cash = 0; if (cash == 0) { Clear(); system("cls"); NGameMenu(); } NewHand(); }
void GamePlay::Fold() { result = "You Win!"; Text(); foldc = false; thirdhand(); NewHand(); }
void SetTime(TIME &t) { SYSTEMTIME time; int i,hour; GetSystemTime(&time); t.min = time.wSecond; t.hour = time.wMinute % 12; for (i = 0; i < time.wSecond; i++) { NewHand(t.xs, t.ys); } for (i = 0; i < time.wMinute; i++) { NewHand(t.xm, t.ym); } hour = (time.wHour % 12+3)%12*5+time.wMinute/12; for (i = 0; i < hour; i++) { NewHand(t.xh, t.yh); } }
LRESULT CALLBACK WndclProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { static HDC hdcch,hdcch1; int width=200, height=200; static HPEN pens, penm, penh; COLORREF clr; PAINTSTRUCT ps; TIME time; LPARAM param; RECT rect; static int timer,min,hour,xs,ys,xm,ym,xh,yh; HBITMAP hbmp; switch (message) { case WM_CREATE: hdcch = GetDC(hWnd); hdcch1 = CreateCompatibleDC(hdcch); hbmp = CreateCompatibleBitmap(hdcch, width, height); pens = CreatePen(PS_SOLID, 1,RGB(0,0,0)); penm = CreatePen(PS_SOLID, 2, RGB(0, 0, 0)); penh = CreatePen(PS_SOLID, 3, RGB(0, 0, 0)); SelectObject(hdcch1, hbmp); rect.left = 0; rect.top = 0; rect.right = width; rect.bottom = height; FillRect(hdcch1, &rect, (HBRUSH)CreateSolidBrush(RGB(255, 255, 255))); SelectObject(hdcch1, penh); Ellipse(hdcch1, 30, 20, 160, 150); TextOut(hdcch1, 88, 25, L"12", 2); TextOut(hdcch1, 145, 75, L"3", 1); TextOut(hdcch1, 90, 130, L"6", 1); TextOut(hdcch1, 35, 75, L"9", 1); ReleaseDC(hWnd, hdcch); timer = SetTimer(hWnd, 1, 1000, NULL); time.xs = 0; time.ys = -60; time.xm = 0; time.ym = -50; time.xh = 0; time.yh = -30; time.min = 0; time.hour = 0; SetTime(time); xs=time.xs; ys=time.ys; xm=time.xm; ym=time.ym; xh=time.xh; yh=time.yh; min=time.min; hour=time.hour; break; case WM_TIMER: hdcch = GetDC(hWnd); min++; if (min== 60) { NewHand(xm, ym); min = 0; xs = 0; ys = -60; hour++; } if (hour == 12) { NewHand(xh, yh); hour = 0; } NewHand(xs, ys); BitBlt(hdcch, 0, 0, 200, 200, hdcch1, 0, 0, SRCCOPY); MoveToEx(hdcch, 95, 85, NULL); SelectObject(hdcch, pens); LineTo(hdcch, xs+95, ys+85); MoveToEx(hdcch, 95, 85, NULL); SelectObject(hdcch, penm); LineTo(hdcch, xm+95, ym+85); MoveToEx(hdcch, 95, 85, NULL); SelectObject(hdcch, penh); LineTo(hdcch, xh+95, yh+85); ReleaseDC(hWnd, hdcch); break; case WM_PAINT: hdcch = BeginPaint(hWnd, &ps); BitBlt(hdcch, 0, 0, 200,200 , hdcch1, 0, 0, SRCCOPY); MoveToEx(hdcch, 95, 85, NULL); SelectObject(hdcch, pens); LineTo(hdcch, xs+95, ys+85); MoveToEx(hdcch, 95, 85, NULL); SelectObject(hdcch, penm); LineTo(hdcch, xm+95, ym+85); MoveToEx(hdcch, 95, 85, NULL); SelectObject(hdcch, penh); LineTo(hdcch, xh+95, yh+85); EndPaint(hWnd, &ps); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; }
void GamePlay::thirdhand() { Checks b; PlayerHandValue = 0; CpuHandValue = 0; result = ""; int x = 24; int y = 3; showc = true; shows = true; PressEnterToContinue = "Press Enter To Continue..."; Checks ck; Poker a; Aesthetics cb; system("cls"); a.createhand(hand, 25, 40); a.createtable(tablehand, 5, 17); // this will create the table, passing in the table hand, always pass in 5 and 7 for location Cards(); a.createtable(cpuhand, x, y);//creating the hands PlayerHandValue = ck.DetermineHand(PlayerValues, psuits);// determine the player hand storing value in PlayerHandValue CpuHandValue = ck.DetermineHand(cvalues, csuits);// determine the cpu hand storing value in CpuHandValue if (foldv) { PlayerHandValue = 0; } ck.determine(PlayerHandValue, CpuHandValue); if (showc) { chand = chand; } if (shows) { PressEnterToContinue = PressEnterToContinue; } if (!foldc) { fold = " "; } if (foldc == true) { //fold = "YOU LOSE!"; } Text(); // method to display the text on screen cin.get(); cout << chand; g = 0; duringhand = true; if (!duringhand) { cb.text1("You Ran Out of Money!"); cin.get(); system("cls"); Clear(); NGameMenu(); } if (cash == 0) { Clear(); system("cls"); NGameMenu(); } if (cpucash == 0) { system("cls"); Aesthetics a; a.textattr(13); cout << " " << endl; cout << " " << endl; cout << " /////////////////////////////////////////////////" << endl; cout << " // "; a.textattr(3); cout << "* * * * * * "; a.textattr(13); cout << "//" << endl; cout << " // "; a.textattr(3); cout << " * "; a.textattr(6); cout << " CPU RAN OUT OF MONEY! "; a.textattr(3); cout << "* "; a.textattr(13); cout << "//" << endl; cout << " // "; a.textattr(3); cout << "* * "; a.textattr(13); cout << "//" << endl; cout << " // "; a.textattr(3); cout << "* "; a.textattr(6); cout << "You Win! "; a.textattr(3); cout << "* "; a.textattr(13); cout << "//" << endl; cout << " // "; a.textattr(3); cout << "* "; a.textattr(3); cout << "* * * "; a.textattr(13); cout << "//" << endl; a.textattr(13); cout << " //"; a.textattr(3); cout << "*********************************************"; a.textattr(13); cout << "//" << endl; a.textattr(13); cout << " /////////////////////////////////////////////////" << endl; cout << " " << endl; cout << " " << endl; cout << " " << endl; NGameMenu2(); } NewHand(); }