summaryrefslogtreecommitdiff
path: root/algo1w4d2/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'algo1w4d2/main.cpp')
-rw-r--r--algo1w4d2/main.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/algo1w4d2/main.cpp b/algo1w4d2/main.cpp
new file mode 100644
index 0000000..1892fbc
--- /dev/null
+++ b/algo1w4d2/main.cpp
@@ -0,0 +1,38 @@
+#include <iostream>
+
+#define BRACKET_CHECK
+
+#ifdef WINKEL_SIM
+#include "WinkelSim.h"
+
+int main() {
+ WinkelSim sim;
+
+ for (unsigned t = 0; t < MAX_TIME_STEPS; t++) {
+ sim.step();
+ std::cout << "tijd: " << t << std::endl << sim << std::endl;
+ }
+
+ return 0;
+}
+#endif
+
+#ifdef BRACKET_CHECK
+#include "BracketCheck.h"
+
+int main() {
+ unsigned i = 0;
+ std::string input;
+
+ while(getline(std::cin, input)) {
+ i++;
+ if (input.size() == 0) {
+ std::cout << std::endl;
+ continue;
+ }
+ BracketCheck parser(input);
+ std::cout << "line " << i << " is " << (parser.input_valid() ? "valid" : "invalid") << std::endl;
+ }
+ return 0;
+}
+#endif