/*************************************************************************** * _ _ * * /_\ Chess Board /_\ * * \_/ ------------------- \_/ * * /_\ Black vs White /_\ * * |_| ------------------- |_| * * /___\ GNU GPL Version 2 /___\ * * * ***************************************************************************/ /* Header Files */ #include #include #include "MENU/cbmenu.h" #include "SET/setting.h" #include "BOA/board.h" #include "NET/network.h" /* Secure */ #define SET #define ENGINE /* Define Port */ #define PORT 5799 /* Global Definitions */ char chess[10]; char ipad[20]; /* Defintions */ Menu cmenu; Set cset; Network network1; Network network2; Network network0; Cboard cgame; //----------------------------------------------------------------------------- /* Main Program */ int main(int agec, char **agev) { /* Chess Game Menu */ while(true) { WINDOW **item; item=cmenu.drawMenu(0); agec=cmenu.scrollMenu(item,6,0); cmenu.deleteMenu(item,6); /* Set Menu Bool */ chess[1] = false; chess[2] = false; chess[3] = false; chess[4] = false; chess[5] = false; chess[6] = false; /* Switch Menu */ switch(agec+1) { #ifdef ENGINE /* Play White */ case 1: chess[1] = 'W'; cgame.displayBoard(chess,network0,network2); break; /* Play Black */ case 2: chess[2] = 'B'; cgame.displayBoard(chess,network0,network2); break; #endif /* Play Human */ case 3: chess[3] = 'e'; cgame.displayBoard(chess,network0,network2); break; #ifdef SET /* Start Server */ case 4: chess[4] = 'S'; cset.settings(ipad, chess); network1.socket(); network1.bind(PORT); network1.listen(); while(true) { network1.accept(network2); while(true) { cgame.displayBoard(chess,network0,network2); } network2.close(); } network1.close(); break; /* Start Client */ case 5: chess[5] = 'C'; cset.settings(ipad, chess); network0.socket(); network0.connect(ipad,PORT); while(true) { cgame.displayBoard(chess,network0,network2); } network0.close(); break; /* Game Settings */ case 6: chess[6] = 'G'; cset.settings(ipad, chess); break; #endif }} touchwin(stdscr); return 0; } //-----------------------------------------------------------------------------