Compilation Description: test the compilation environment: UbuntuLinux7.10 (kernel version 2.6.22), gcc, and surese graphics library support (please refer to surese related materials) graphic interface requirements: Compilation command: gccshell. cai. cgraphics. c-oh.out-lcursesshell.c // modify where open file # include "datastruct. h "is # include" graphics. h"
Compilation instructions:
Test the compiling environment: Ubuntu Linux 7.10 (kernel version 2.6.22), gcc, and surese graphics library support (please refer to surese related materials)
Graphical interface requirement: Compile command: gcc shell. c ai. c graphics. c-o h. out-l curses
Shell. c // open the file # include "datastruct. h" to # include "graphics. h"
Ai. h // open the file # include "datastruct. h" to # include "graphics. h"
Ai. c
Graphics. h
Graphics. c
Character interface requirement: Compile command: gcc shell. c ai. c datastruct. c-o h. out
Shell. c // reverse returns the same as above
Ai. h
Ai. c // comment out the endwin () of lines 11 and 17 ();
Datastruct. h
Datastruct. c
Source program
Linux graphical interface ghost tower source program (c, oop)
Program Composition:
The program has two sets of optional solutions.
1: character interface, which only involves internal operations.
2: graphic interface, with real-time graphical display function.
File description:
Design Concept: Driver> Intelligent Simulation> operation object
General part:
Shell. c: shell. The organization program runs and checks user input data;
Ai. h: Smart simulation-mobile tower;
Ai. c <由ai.h导出> ;
Solution 1: character Interface
Datastruct. h: entity simulation of the tower-structure and operations that can be performed on the tower;
Datastruct. c: Implementation of the tower structure and operations that can be performed <由datastruct.h导出> ;
Solution 2: graphic interface
Graphics. h: entity simulation of the tower-structure and operations that can be performed on the tower;
Graphics. c: entity simulation of the tower-structure and operations that can be performed on the tower;