From 6f164188a310600d3eb4faa03cd0a38a10176373 Mon Sep 17 00:00:00 2001 From: Johannes Theiner Date: Wed, 25 Apr 2018 14:00:57 +0200 Subject: [PATCH] MP_03 Testat Teil1 --- 03_FLOW_a/Testat/build.sh | 5 ++ 03_FLOW_a/Testat/flow.out | Bin 0 -> 21952 bytes 03_FLOW_a/Testat/main_mp2_FLOW_a.cpp | 87 +++++++++++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100755 03_FLOW_a/Testat/build.sh create mode 100755 03_FLOW_a/Testat/flow.out create mode 100644 03_FLOW_a/Testat/main_mp2_FLOW_a.cpp 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 0000000000000000000000000000000000000000..775958240c6c11005efae0c407792a2e0c26d401 GIT binary patch literal 21952 zcmeHPdvsgHnIBsY36R)I2*n!$2pYhljgb^PabUY#$5yxoJ7{CO1ln+=$cn9EOR65h zp*0vxpsH|ddI(MT&>oj7wrlerl6z}hw zJ0stFB|$M~_b&CEBC`xxEoYu#2}R>ov1XMe{CbFNl6$@pe$a63l@t%04& z6m||<%T57h2|fzv5HxZU&I!{JE)#MNzzTdC$_+w8xxzCNt~JOg!AR0Wf>ho@Qbg8( zk6dh^5;ErE1kxj4r#EmEFu*ess^k#TXx_Ms2neqhAjwklzmV#p{HTjCf{F#!QALm>lzM*;J@WIfO->=WLzGvlUEIQd2}SYj z(%#7KO?8*{c5Ud5MAQ8n`WrTF*i=`WjMaL1y~#ewUb(%Kmqg7gn~Dg8pNkL4kl*EB zSXq9)V|5wP&d28hd`=s<>aL#2wa1e8EiJFQwU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*2m6UOUA$CHY>HzQMqyoPibU{}K#}J*h9>3y{AzDLaP74<%_&#=#6|)P8yW zO9R00zR{%|&xes%V=Uml71T4LirLu zfehJ_{>!6O)k5Dd15+rt1eD+{WT<@Mt|a5RfRRn)DMm(C#|&*naKRCw?-JvW)){(+ rD(fxdg2tEhohyp3vA;7iPf>80k}Ow}Rw7eO|CTmGqTHrnL)rfV*snd7 literal 0 HcmV?d00001 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++; +}*/