home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / Apps / Games / UnixGames / accordian / Source / help.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-28  |  1.6 KB  |  79 lines

  1.  
  2. /*
  3.  * the accordian help stuff
  4.  */
  5.  
  6. #include <stdio.h>
  7. #include <curses.h>
  8. #include "cards.h"
  9.  
  10. #define HELPHEIGHT 22
  11.  
  12. char *helplist[] = {
  13.         "          Welcome to Accordian Solitaire!",
  14.         "",
  15.         "The goal of the game is to deal all cards from the",
  16.         "deck, and stack them into a single pile of cards.",
  17.         "Cards can move onto other cards that are one or",
  18.         "three cards up in the deck.  Cards can only stack",
  19.         "onto other cards of the same suit or rank.",
  20.         "",
  21.         "Select cards by typing their face value and suit.",
  22.         "The card moves automatically if it has only one move.",
  23.         "You must choose the move if there are multiple moves.",
  24.         "",
  25.         "         Keys :",
  26.         "           `d' : Deal a card from the deck",
  27.         "           `D' : Deal the whole deck",
  28.         "           `f' : Find a card that can move",
  29.         "           `s' : Save a copy of the deck",
  30.         "           `u' : Undo the last move",
  31.         "           `r' : Restore the saved deck",
  32.         "           `x' : Exit from Accordian",
  33.         "          `^R' : Redraw the screen",
  34.     0 };
  35.  
  36. help()
  37. {
  38.     int c2, ch, done, start;
  39.  
  40.     clear();
  41.  
  42.     c2 = start = 0;
  43.     done = FALSE;
  44.  
  45.     while (!done) {
  46. Help:        for (c2 = start; c2 < start + HELPHEIGHT; c2++) {
  47.             if (helplist[c2] == 0) {
  48.                 done = TRUE;
  49.                 break;
  50.             }
  51.             move(1 + (c2 % HELPHEIGHT),13);
  52.             printw("%s",helplist[c2]);
  53.         }
  54.  
  55.         move(23,26);
  56.         printw("     - hit any key -       ");
  57.         move(23,48);
  58.     
  59.         refresh();
  60.         ch = getch();
  61.         switch (ch) {
  62.             case 0x12 :
  63.             case 0x0c :
  64.                 clear();
  65.                 c2 = start;
  66.                 goto Help;
  67.                 break;
  68.             case 'x' :
  69.             case 'X' :
  70.             case 'q' :
  71.             case 'Q' :
  72.                 done = TRUE;
  73.                 break;
  74.         }
  75.         start = c2;
  76.     }
  77. }
  78.  
  79.