diff --git a/03_FLOW_a/Testat/build.sh b/03_FLOW_a/Testat/build.sh new file mode 100755 index 0000000..92600ce --- /dev/null +++ b/03_FLOW_a/Testat/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash +rm *.out +clang++-6.0 -std=c++14 -I ../../helpers -o flow.out main_mp2_FLOW_a.cpp ../../helpers/AnsiConsole.cpp + +./flow.out diff --git a/03_FLOW_a/Testat/flow.out b/03_FLOW_a/Testat/flow.out new file mode 100755 index 0000000..7759582 Binary files /dev/null and b/03_FLOW_a/Testat/flow.out differ diff --git a/03_FLOW_a/Testat/main_mp2_FLOW_a.cpp b/03_FLOW_a/Testat/main_mp2_FLOW_a.cpp new file mode 100644 index 0000000..4b4a451 --- /dev/null +++ b/03_FLOW_a/Testat/main_mp2_FLOW_a.cpp @@ -0,0 +1,87 @@ +#include /* file main_mp2_FLOW_a.cpp */ +#include "AnsiConsole.h" + +AnsiConsole console; int firstLine; int currentTick; Colors currentColor; +#define INITPRINT(label) {firstLine=__LINE__;console.printText(2*currentTick,0,label,Colors::BLACK);} +#define PRINT printLineNumber(__LINE__) +void printLineNumber(int lineNumber); + +void help(int i); +void help2(); + + + + + + +void recurse2(int i) { + if(i == 0) {help2(); return;} + PRINT;recurse2(i-1);return; +} +void help2() {PRINT; + //recurse2(3); + PRINT; +} + + + +void recurse(int i) { + if(i == 0) {help(2); return;} + PRINT;recurse(i-1);return; +} +void help(int i) {if(i % 2 == 0)PRINT; + else { + PRINT; + recurse(3); + } +} + + + +void iterationA(int x) { + for(int i = 0; i < 3; ++i) + PRINT; + if(x % 2 != 0) + PRINT; + else + PRINT; +} + +void startA() { + iterationA(1); + iterationA(2); + iterationA(3); + iterationA(4); +} + + +int main(int argc, const char * argv[]) { + + console.clearScreen(); + + currentColor = Colors::GREEN; + + //startA(); + recurse2(3); + + std::string s; + std::cin >> s; + + + return 0; +} + + + +void printLineNumber(int lineNumber){ + std::string line = std::to_string(lineNumber); + currentTick++; + console.printText(currentTick*2-1, 1+lineNumber-firstLine, line, currentColor); +} + + +/*void printLineNumber(int lineNumber){ + std::string line = std::to_string(lineNumber); + console.printText(currentTick*2, 1+lineNumber-firstLine, line, currentColor); + currentTick++; +}*/