home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * the accordian help stuff
- */
-
- #include <stdio.h>
- #include <curses.h>
- #include "cards.h"
-
- #define HELPHEIGHT 22
-
- char *helplist[] = {
- " Welcome to Accordian Solitaire!",
- "",
- "The goal of the game is to deal all cards from the",
- "deck, and stack them into a single pile of cards.",
- "Cards can move onto other cards that are one or",
- "three cards up in the deck. Cards can only stack",
- "onto other cards of the same suit or rank.",
- "",
- "Select cards by typing their face value and suit.",
- "The card moves automatically if it has only one move.",
- "You must choose the move if there are multiple moves.",
- "",
- " Keys :",
- " `d' : Deal a card from the deck",
- " `D' : Deal the whole deck",
- " `f' : Find a card that can move",
- " `s' : Save a copy of the deck",
- " `u' : Undo the last move",
- " `r' : Restore the saved deck",
- " `x' : Exit from Accordian",
- " `^R' : Redraw the screen",
- 0 };
-
- help()
- {
- int c2, ch, done, start;
-
- clear();
-
- c2 = start = 0;
- done = FALSE;
-
- while (!done) {
- Help: for (c2 = start; c2 < start + HELPHEIGHT; c2++) {
- if (helplist[c2] == 0) {
- done = TRUE;
- break;
- }
- move(1 + (c2 % HELPHEIGHT),13);
- printw("%s",helplist[c2]);
- }
-
- move(23,26);
- printw(" - hit any key - ");
- move(23,48);
-
- refresh();
- ch = getch();
- switch (ch) {
- case 0x12 :
- case 0x0c :
- clear();
- c2 = start;
- goto Help;
- break;
- case 'x' :
- case 'X' :
- case 'q' :
- case 'Q' :
- done = TRUE;
- break;
- }
- start = c2;
- }
- }
-
-