home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_200
/
270_01
/
t3.doc
< prev
next >
Wrap
Text File
|
1979-12-31
|
3KB
|
53 lines
/*
HEADER: CUG270.01;
TITLE: Three dimensional Tic-Tac-Toe;
DATE: 06/15/1988;
DESCRIPTION: "Plays a game of three dimensional tic-tac-toe
on a board consisting of four levels of four
rows by four columns";
VERSION: 1.0;
KEYWORDS: TTT3D, GAMES ;
FILENAME: T3.DOC ;
SEE-ALSO: T3MAIN.C, T3INIT.C, T3INTRO.C, T3PLAYER.C, T3COMP.C
T3DISP.C, T3CONV.C, T3GLOBAL.H ;
COMPILERS: vanilla, Microsoft 4.0, UNIX/5 ;
SYSTEM: MS-DOS 3.3 ;
AUTHORS: Scott Holland ;
*/
COPYRIGHT 1988 Scott Holland
This disk contains a group of C routines and subroutines which
make up a three dimensional tic-tac-toe game program.
All the files associated with this program begin with the characters
T3.
The introduction to the program describes how to use it.
A summary of the functions of each of the C routines follows.
The main routine (T3MAIN.C) initializes variables and arrays through
a call to init (T3INIT.C). An introduction is printed through the
routine intro (T3INTRO.C). The game is then played through properly
sequenced calls to display_board (T3DISP.C), player_move (T3PLAYER.C)
and computer_move (T3COMP.C). Conv_move and conv_to3 (T3CONV.C) are
used to convert moves to and from an internal representation of 0 to
63 and the external representation of a three digit number where the
digits represent the level, row and column. T3GLOBAL.H is used to
define variables and arrays that are used in several of the subroutines.
The player can win the game! Several additional strategy levels
in T3COMP.C might make the game perfect or a whole different approach
to selecting the computers move might be better. The strategy used is
based upon an old FORTRAN program (pre 1971).
The display is generated using standard c I/O routines which
should make this program very portable. I have run prior versions
of the program on UNIX. A nice graphics display with graphical
input would make a nice addition to the program but would probably
reduce portability significantly.
The c source and this description file may be freely distributed
for non-commercial purposes. If any changes are made to these routines
and they are distributed, please note the author, purpose and date
of any changes in the appropriate file headers.