Created
November 3, 2015 14:34
-
-
Save mperlet/8fa910d8282c702e70ce to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <iostream> | |
#include <unistd.h> | |
using namespace std; | |
class programming | |
{ | |
private: | |
int variable; | |
public: | |
int state; | |
programming(){ | |
state= 0; | |
} | |
void next_state() | |
{ | |
switch ( state ) | |
{ | |
case 0 : cout << "R__\n"; break; | |
case 1: cout << "RY_\n"; break; | |
case 2: cout << "__G\n"; break; | |
case 3: cout << "_Y_\n"; state = -1; break; | |
default: cout << "error"; break; | |
} | |
state++; | |
} | |
}; | |
main() | |
{ | |
programming *obj = new programming(); | |
while(true) | |
{ | |
printf("\e[1;1H\e[2J"); // clear terminal hackkkkk | |
obj->next_state(); | |
usleep(1000*1000); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment