1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
#include <iostream>
#include "baseball.h"
#include "windows.h"
using namespace std;
int NT_SetConsoleDisplayMode(HANDLE hOutputHandle, DWORD dwNewMode);
int main()
{
double fpart;
int atbats,runs,totalhits,hits,single,doubles,triples,homeruns;
int runbatin,totalbases,walks,strikeouts,steals,caughtsteal,total_sba;
int sacfly,sachits,dinterfer,hitp,intwalk,gdoubleplay,plateappear;
int numpitch,xbasehits,groundout,flyout;
int menuchoice;
int wins,loss,games,gamesstart,compgame,shutouts,saves,saveop;
int hitsa,runsa,earnruns,homeruna,walksa,strikeoutsa,totalbasea,hitspa;
int balks,wildp,intentwalk,stealsa,caughtsa,tsteala,pickoff,groundouta,flyouta;
int tplatea,numpitchp,holds,gamesf;
float sbper,onbaseper,slugper,bavg,gofor,onbaseslgper,isopower,runscre,sbruns;
float era,ip,winper,sbperp,gofop,pitchperip,soratio,kpernine,bbpernine,hitpernine;
float whip,innpit;
bool temp;
NT_SetConsoleDisplayMode( GetStdHandle( STD_OUTPUT_HANDLE ), 1 );
menuchoice=0;
temp=false;
does some things
function to make console full screen
int NT_SetConsoleDisplayMode(HANDLE hOutputHandle, DWORD dwNewMode)
{
typedef BOOL (WINAPI *SCDMProc_t) (HANDLE, DWORD, LPDWORD);
SCDMProc_t SetConsoleDisplayMode;
HMODULE hKernel32;
BOOL bFreeLib = FALSE, ret;
const char KERNEL32_NAME[] = "kernel32.dll";
hKernel32 = GetModuleHandleA(KERNEL32_NAME);
if (hKernel32 == NULL)
{
hKernel32 = LoadLibraryA(KERNEL32_NAME);
if (hKernel32 == NULL)
return FALSE;
bFreeLib = true;
}//if
SetConsoleDisplayMode =
(SCDMProc_t)GetProcAddress(hKernel32, "SetConsoleDisplayMode");
if (SetConsoleDisplayMode == NULL)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
ret = FALSE;
}//if
else
{
DWORD dummy;
ret = SetConsoleDisplayMode(hOutputHandle, dwNewMode, &dummy);
}//else
if (bFreeLib)
FreeLibrary(hKernel32);
return ret;
}//NT_SetConsoleDisplayMode
|