📄 main.cpp
字号:
#include "../../C/UTILITY.H"
#include "../../C/UTILITY.CPP"
#include "../../6/LINKLIST/LIST.H"
#include "../../6/LINKLIST/LIST.CPP"
#include "CELL.H"
#include "HASH.H"
#include "HASHFN.CPP"
#include "HASH.CPP"
#include "LIFE.H"
#include "LIFE.CPP"
void instructions()
{
cout << " Life version 2 \n\n";
cout << "Welcome to Conway's game of Life on an unbounded grid.\n\n";
cout << "This implementation uses a hash table to locate cells.\n";
cout << "The Life cells are supposed to be on an unbounded grid.\n";
cout << "A data structure such as a hash table allows a virtually\n";
cout << "unlimited size cell storage area thus allowing an unbounded\n";
cout << "grid to be produced.\n\n";
}
int main() // Program to play Conway's game of Life.
/*
Pre:
The user supplies an initial configuration of living cells.
Post:
The program prints a sequence of pictures showing the changes in
the configuration of living cells according to the rules for
the game of Life.
Uses:
The class Life and its methods initialize(),
print() and update().
The functions instructions(), user_says_yes().
*/
{
Life configuration;
instructions();
configuration.initialize();
configuration.print();
cout << "Continue viewing new generations? " << endl;
while (user_says_yes()) {
configuration.update();
configuration.print();
cout << "Continue viewing new generations? " << endl;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -