-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
37 lines (30 loc) · 858 Bytes
/
main.cpp
File metadata and controls
37 lines (30 loc) · 858 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
36
37
#include <iostream>
#include <bitset>
#include <cstdio>
#include <cstring>
#include <fstream>
#include <map>
#include "simulator.h"
using namespace std;
#define INPUTNUM 256
#define OUTPUTNUM 128
int main(int argc, char *argv[])
{
Simulator sim;
if (argc < 2) {
char filename[64];
scanf("%s", filename);
sim.openCode(filename);
}
else {
sim.openCode(argv[1]);
}
string s = "1001011110001010001110100101101001010011101001011010110111011010001011010001101101101001011011010011010111101010010010110101001111001011011110010001111011000101101000111011101110001101101001100101110110100011101001110110110101100101001010011011101001001101";
sim.importInput(&s, 1);
while (sim.waitCommand()) {
sim.execCommand();
}
sim.printOutput(1);
sim.closeCode();
return 0;
}