kleinere Änderungen die noch nichts bringen

This commit is contained in:
Johannes Theiner 2018-08-31 14:05:18 +02:00
parent 28a90c24b5
commit 39efce229f
3 changed files with 16 additions and 12 deletions

View File

@ -21,11 +21,8 @@ void recurse2(int i, int rounds) {
} }
else if(i == 0 && rounds == 1) { else if(i == 0 && rounds == 1) {
recurse2(3, 0); recurse2(3, 0);
} }else {recurse2((i-1), 2);}
else
return;
PRINT;recurse2(i-1, 2);
} }
void help2() {PRINT; void help2() {PRINT;
recurse2(3, 1); recurse2(3, 1);
@ -36,7 +33,7 @@ void help2() {PRINT;
void recurse(int i) { void recurse(int i) {
if(i == 0) {help(2); return;} if(i == 0) {help(2); return;}
PRINT;recurse(i-1);return; PRINT;recurse(i-1);
} }
void help(int i) {if(i % 2 == 0)PRINT; void help(int i) {if(i % 2 == 0)PRINT;
else { else {
@ -81,8 +78,8 @@ int main(int argc, const char * argv[]) {
* 1x main * 1x main
*/ */
//startA(); startA();
recurse2(3, 2); //recurse2(3, 2);
std::string s; std::string s;
std::cin >> s; std::cin >> s;
@ -104,4 +101,4 @@ void printLineNumber(int lineNumber){
std::string line = std::to_string(lineNumber); std::string line = std::to_string(lineNumber);
console.printText(currentTick*2, 1+lineNumber-firstLine, line, currentColor); console.printText(currentTick*2, 1+lineNumber-firstLine, line, currentColor);
currentTick++; currentTick++;
}*/ }*/

View File

@ -44,7 +44,8 @@ bool operator!=(BinaryOctet a, BinaryOctet b) {
return true; return true;
} }
BinaryOctet operator--(BinaryOctet &id, int) { const BinaryOctet operator--(BinaryOctet &id, int) {
return id; return id;
} }
@ -64,8 +65,12 @@ BinaryOctet operator/(BinaryOctet a, BinaryOctet b) {
} }
BinaryOctet& BinaryOctet::operator=(int const &i) { BinaryOctet& BinaryOctet::operator=(int const &a) {
init(i); std::cout << a << std::endl;
std::string tmp = to_string(a);
for(int i = 0; i < bitsPerOctet; i++) {
bitsAsDigits[i] = tmp[i];
}
return *this; return *this;
} }
@ -99,6 +104,9 @@ std::ostream& operator<< (std::ostream& os, const BinaryOctet &toBePrinted){
int main(int argc, char **argv) { int main(int argc, char **argv) {
BinaryOctet a = 0b00001111; BinaryOctet a = 0b00001111;
BinaryOctet b = 0b00000110; BinaryOctet b = 0b00000110;
std::cout << a << std::endl;
BinaryOctet c = 00001111;
std::cout << c << std::endl;
std::cout << new BinaryOctet(5) << std::endl; std::cout << new BinaryOctet(5) << std::endl;
println(a + b); println(a + b);
std::cout << a + b << std::endl; std::cout << a + b << std::endl;

View File

@ -39,7 +39,6 @@ class Point : public Shape{
public: public:
explicit Point(int x, int y, Colors color); explicit Point(int x, int y, Colors color);
void draw() override; void draw() override;
}; };