From 6ff4a41273439b146512fb8d1d41a2b76aaa2b70 Mon Sep 17 00:00:00 2001 From: Johannes Theiner Date: Tue, 23 Oct 2018 11:17:40 +0200 Subject: [PATCH] 03_FLOW_Testat bestanden --- src/03_FLOW/Testat/main_mp2_FLOW_a.cpp | 55 +++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/src/03_FLOW/Testat/main_mp2_FLOW_a.cpp b/src/03_FLOW/Testat/main_mp2_FLOW_a.cpp index 2ee00c1..4b249ca 100644 --- a/src/03_FLOW/Testat/main_mp2_FLOW_a.cpp +++ b/src/03_FLOW/Testat/main_mp2_FLOW_a.cpp @@ -5,9 +5,56 @@ AnsiConsole console; int firstLine; int currentTick; Colors currentColor; -#define INITPRINT(label) {firstLine=__LINE__;console.printText(2*currentTick,0,label,Colors::BLACK);} +#define INITPRINT(label) {firstLine=__LINE__;console.printText(2*currentTick,0,label,Colors::WHITE);} #define PRINT printLineNumber(__LINE__) void printLineNumber(int lineNumber); +void b();void asub();void csub();void c(); +void d() { + INITPRINT("c"); + c(); +} + +void csub() { + for(int i = 0; i <= 2; i++) { + PRINT; + } +} +void a() { + INITPRINT("a"); + asub();PRINT;asub();PRINT;asub();PRINT; +} + +void b() { + INITPRINT("b"); + for(int i = 0; i <= 4; i++) { + if(i % 2) { + + asub();PRINT;} + else { + asub();PRINT; + } + } +} + +void c() { + for(int i = 0; i <= 4; i++) { + if(i % 2) { + + csub();PRINT;} + else { + csub();PRINT; + } + } +} + + + + +void asub() { + for(int i = 0; i <= 2; i++) { + PRINT; + } +} int main(int argc, const char *argv[]) { @@ -15,6 +62,10 @@ int main(int argc, const char *argv[]) { console.clearScreen(); currentColor = Colors::GREEN; + + //a(); + //b(); + d(); std::string s; std::cin >> s; @@ -27,4 +78,4 @@ void printLineNumber(int lineNumber) { std::string line = std::to_string(lineNumber); currentTick++; console.printText(currentTick * 2 - 1, 1 + lineNumber - firstLine, line, currentColor); -} \ No newline at end of file +}