// v-ttt.h

/*

Copyright Notice:

Copyright (C) 2006, 2015 R Veera Kumar

This file is part of v-ttt.

v-ttt 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, version 3 of the License.

v-ttt 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 v-ttt.  If not, see <http://www.gnu.org/licenses/>.

See the COPYING file distributed together for license information.

See the AUTHOR file distributed together for authors information.

*/

#include "vsyscfg.h"
#include "vsyscfgg.h"

#if V_SYSTEM == DOS
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <time.h>
#include <string.h>
#define GETCH getch
#endif

#if V_SYSTEM == UNIX
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <termios.h>
#include <time.h>
#include <string.h>
#include <signal.h>

void vterm_end (void);
void vterm_init (void);
void v_sig_tstp (int sig);
void v_sig_cont (int sig);

#define GETCH getchar

#endif

void printttt(void);
void ttt_m_in(void);
char ttt_m_ui(char menu, char wchk_st2);
char ttt_m_wchk(signed short int cstep, char wchk_st2);
void ttt_m_cpl(signed short int cstep, char wchk_st2, char D);
void ttt_menu(void);
void ttt_help(void);
void ttt_tips(void);
void ttt_license(void);
void ttt_about(void);
void cpl_rf_d3(signed short int mn, signed short int * rf_d);

#define V_NAME "Veera - Tic Tac Toe"
#define V_DESC "A Game of Tic-Tac-Toe"
#define V_VERSION "0.1"
#define V_AUTHOR "R Veera Kumar"
#define V_CONTACT_EMAIL "vsw@veera.biz"
#define V_CONTACT_WEB "http://www.veera.biz/sw/my_sw/"
#define V_CONTACT_WEB2 "http://v-ttt.sourceforge.net/"
#define V_LICENSE "GNU GPL Version 3"
#define V_COPYRIGHT "Copyright (C) 2006, 2015"

const char * v_text_new_game = "\n\
                New Game\n\
               ==========\n\n\
 Press U - Your play first\n\
 Press C - Computer plays first";

const char * v_text_about =
"\n "
V_NAME "\n "
V_DESC "\n "
"Version: " V_VERSION "\n "
"Author: " V_AUTHOR "\n "
"Email: " V_CONTACT_EMAIL "\n "
"Website: " V_CONTACT_WEB "\n "
"Website2: " V_CONTACT_WEB2 "\n "
"Copyright: " V_COPYRIGHT "\n "
"License: " V_LICENSE;

const char * v_text_license = 
"\n "
V_NAME "\n "
"Version: " V_VERSION "\n "
"Author: " V_AUTHOR "\n "
"Email: " V_CONTACT_EMAIL "\n "
"Website: " V_CONTACT_WEB "\n "
"Website2: " V_CONTACT_WEB2 "\n "
"Copyright: " V_COPYRIGHT "\n "
"License: " V_LICENSE "\n\n "
"For complete license, read the COPYING file\n\
 distributed together.";


const char * v_text_tips = 
"\n\
                             Tips\n\
                             ====\n\n\
    | X |           | O |           | O |         O | X |         O |   | X\n\
 ---|---|---     ---|---|---     ---|---|---     ---|---|---     ---|---|---\n\
    | O |           |   | X         |   |           |   |           |   |\n\
 ---|---|---     ---|---|---     ---|---|---     ---|---|---     ---|---|---\n\
    |   |           |   |           |   | X         |   |           |   |\n\
\n\
  O |   |         O |   |         O |   | O \n\
 ---|---|---     ---|---|---     ---|---|---\n\
    |   | X         |   |         X | O |   \n\
 ---|---|---     ---|---|---     ---|---|---\n\
    |   |           |   | X       X |   |   \n\n\n\
 Avoid the first seven situations. They lead to sure win\n\
 of one player. And try to get arrangement like in eigth case;\n\
 where there is a sure win.";

const char * v_text_help =
"\n\
                    Help\n\
                   ======\n\n\
          M - Exit to Main Menu\n\
          N - New Play\n\
          P - Set Player Name\n\
          D - Difficulty Setting\n\
          R - Resume previous game\n\
          S - View Scores\n\
          H - Help\n\
          L - License\n\
          A - About\n\
          Q - Quit Game\n\n\
 Start the game by pressing N in the main menu.\n\
 Press U or C for you to play first or the computer.\n\
 Use numeric keypad to play. Numbers from 1-9.\n\n\
 To win the game any of the horizontal and/or vertical\n\
 and/or diagnol squares should be same.\n\n\
 Choose difficulty level using B - Beginner, I - Intermediate\n\
 or E - expert. You can resume a previous game by using R\n\
 Press T to view tips about the game.";

const char * v_text_menu =
"\n\
               =======================\n\
               #  Veera Tic Tac Toe  #\n\
               =======================\n\n\n\
               N - New Play\n\
               P - Set Player Name\n\
               D - Difficulty Setting\n\
               R - Resume previous game\n\
               S - View Scores\n\
               H - Help\n\
               L - License\n\
               A - About\n\
               Q - Quit Game\n\n\n "
 V_NAME ". " "Version " V_VERSION ", " V_COPYRIGHT " " V_AUTHOR "." "\n\
 V - Tic Tac Toe comes with ABSOLUTELY NO WARRANTY.\n\
 This is free software, and you are welcome to redistribute it\n\
 under certain conditions. type `L' for details.";

const char * v_text_scores =
"\n\
           Scores\n\
          ========\n";

const char * v_text_diff =
"\n\
           Difficulty Setting\n\
          ====================\n\n\
 Press B - Beginner\n\
 Press I - Intermediate\n\
 Press E - Expert\n\n";


