-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (30 loc) · 673 Bytes
/
main.cpp
File metadata and controls
35 lines (30 loc) · 673 Bytes
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
#include <iostream>
#include "cellular_automaton.h"
#include "constants.h"
using namespace std;
void test();
int main() {
int dec = 0;
bool world[MAX_ROW][MAX_COL];
bool rule[8];
while (true) {
cout << ": ";
cin >> dec;
initialize(world);
initBoolArray(rule, 8);
dec_to_bin(dec, rule);
automateAll(world, rule);
print2d(world);
}
}
void test() {
bool rule[8];
initBoolArray(rule, 8);
dec_to_bin(54, rule);
printBoolArray(rule, 8);
bool top[3] = {false, false, false};
int topType = 0;
bin_to_dec(top, topType);
topType = 7 - topType;
cout << topType << endl;
}