-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
45 lines (41 loc) · 1.01 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <iostream>
#include <utility>
#include <list>
#include "Board.h"
using Life::Board;
using std::cout;
using std::endl;
using std::pair;
using std::list;
int main (int argc, char **argv) {
constexpr int height = 23;
constexpr int width = 38;
Board b (height, width);
cout << b << endl;
list<pair<int, int>> pattern = {
{5 , 1}, {5, 2}, {6, 1}, {6, 2}
, {3, 36}, {4, 36}, {3, 35}, {4, 35}
, {5, 11}, {6, 11}, {7, 11}, {4, 12}, {8, 12}, {3, 13}, {3, 14}, {9, 13}, {9, 14}
, {6, 15}, {4, 16}, {8, 16}, {5, 17}, {6, 17}, {7, 17}, {6, 18}
, {3, 21}, {4, 21}, {5, 21}, {3, 22}, {4, 22}, {5, 22}, {2, 23}, {6, 23}
, {1, 25}, {2, 25}, {6, 25}, {7, 25}
};
b.updateList (pattern);
for (int i = 0; i < 100; i++) {
cout << b << endl;
b.step();
}
cout << b << endl;
cout << b.getHeight() << endl;
cout << b.getWidth() << endl;
Board c = b;
c.toggle (10, 10);
cout << b << endl;
cout << c << endl;
for (int i = 0; i < 20; i++) {
cout << c << endl;
c.step();
}
cout << b.reset() << endl;
return 0;
}