Skip to content

Instantly share code, notes, and snippets.

@mperlet
Created November 3, 2015 14:34
Show Gist options
  • Save mperlet/8fa910d8282c702e70ce to your computer and use it in GitHub Desktop.
Save mperlet/8fa910d8282c702e70ce to your computer and use it in GitHub Desktop.
#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