main.cpp
来自「数据结构与程序设计教材源码 数据结构与程序设计教材源码」· C++ 代码 · 共 33 行
CPP
33 行
#include "../../C/UTILITY.H"
#include "LIFE.H"
#include "../../C/UTILITY.CPP"
#include "LIFE.CPP"
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 + =
减小字号Ctrl + -
显示快捷键?