/* YmcFace
   yawn?
    machine
     coroutine
      functional
       anal?
        cum?
         engine
YmcFace is a personnal rebrand of actual duffman machine like coroutine implementation
I dived into interactive fictions in order to solve the multiple different coexisting gameplay challenge
and i found that design pattern while coding a source parser (actually wrote 2 big professionnally)
and on a minimalist concept enabling automatic coding like absurd litteratur era. it worked. and is simple
now this Coroutine implementation switch between context with tail call style
all coroutine chain up and carry along side whatever i will put here

TODO:
default route
error handling
logging framework
*/
typedef struct CO CO;
typedef void (*ROUTINE)(CO*);
typedef char** LLECTION;
struct CO{
	ROUTINE again;
	LLECTION bag;
};
void NOW(ROUTINE);
void GTFO(CO*);

void Begin(CO*);
void Loop(CO*);
void End(CO*);

/* MILF
Mediocre Inbetween Legacy Fapping
minimalist text ui, first implement is ncurses
expect conio.h/sdl/web port

 */
void TBegin();
void TEnd();
#define W 32
#define H 24
#define Fps 14;
enum COLOR { RED, GREEN, BLUE, YELLOW, MAGENTA, CYAN, WHITE, BLACK };
enum BTN {Any, A, B, Up, Dn, Lt, Rt, Pause};
//print    txt    col  row  fg   bg
void Prnt(char *,char,char,enum COLOR);
//plot  col  row  fg   bg
void Plt(char,char,enum COLOR);
//refresh screen, then clear canvas for next frame (also reset button in this case)
void Clr();
//button state get flag if button is pressed
//button   button
int Btn(enum BTN);
//tick wait for the next tick, and keep in sync with Fps
void Tck();

/* BANG
   beat
    audio
     nun?
      generator
*/
void ABegin();
void AEnd();
//tone play tone of hz / time
//tone        hz            time
void Tn(unsigned short,unsigned short);
//tone pulse
void Bt();

/* BDSM
   base
    data
     saving
      management
 */
//load data
typedef char** DATA;
//load  slot
DATA Ld(char);
//save  slot data return slot
char Sv(char,DATA); 
