/* csol - CURSES solitaire Copyright (C) 2018 Ian Cowburn (ianc@noddybox.co.uk) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ------------------------------------------------------------------------- Main */ #include #include #include #include #include "deck.h" #include "pile.h" #include "util.h" #include "klondike.h" int main(int argc, char *argv[]) { int key; int opt = 1; int quit = FALSE; srand(time(NULL)); initscr(); cbreak(); noecho(); keypad(stdscr, TRUE); while(!quit) { erase(); Centre(1, "CURSES solitaire"); Centre(3, "1 .. Klondike (draw three)"); Centre(4, "2 .. Klondike (draw one)"); Centre(5, "Q .. Quit"); key = getch(); switch(key) { case '1': erase(); Klondike(3); break; case '2': erase(); Klondike(1); break; case 'q': case 'Q': quit = TRUE; break; case '?': erase(); Centre(2, "Press the indicated key to select the menu item."); Centre(4, "Press SPACE to continue."); refresh(); while(getch() != ' '); break; default: break; } } erase(); refresh(); endwin(); return EXIT_SUCCESS; } /* vim: ai sw=4 ts=8 expandtab */