
#include "../funk/funk.h"

//typedef signed char Num;
//typedef unsigned char * Str;

/* 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
*/
void TBegin();
void TEnd();
/* MILF
Mediocre Inbetween Legacy Fapping
minimalist text ui, first implement is ncurses
expect conio.h/sdl/web port

 */

//think about an upgrade in power
//you can merge A_BOLD|color_pair(), so each color are either dimmer or bolder yield 192 colors...
//conio already have three shade of ckboard so it must be managed apart from colors
typedef enum COLOR {
/*first colors dont reinit as wanted,beyond 65 , no more colors possibles*/
Black=0,     Red,     Green,      Blue,      White,     Cyan,     Yellow,     Magenta, 
Redless,     Reder,   Brown,      Purple,    Pink,      Dawn,     Orange,     Fushia,
Greenless,   BrownR,  Greener,    Turquoise, Lime,      Emerald,  Chartreuse, Gray,
Blueless,    PurplR,  TurquoisR,  Bluer,     Lavende,   Azure,    Coal,       Violet,
Whiteless,   PinkR,   LimeR,      LavenderR, Whiter,    Electric, Sepia,      Orchid,
Cyanless,    DawnR,   EmeraldR,   AzureR,    ElectricR, Cyaner,   Mint,        Cobalt,
Yellowless,  OrangeR, ChartreusR, CoalR,     SepiaR,    MintR,    Yellower,   Coral,
Magentaless, FushiaR, GrayR,      VioletR,   OrchidR,   CobaltR,  CoralR,     Magentaer,
Colors=64
} Color;

//print    txt    col  row  fg   bg
void Prnt(Let[],Let,Let,Color);
//same as above but top down vertical printing
void Lbl(Let[],Let,Let,Color);
//plot  col  row  fg   bg
void Plt(Let,Let,Color);

typedef enum Symbol{
    Here  = 0b00000000,
    North = 0b00000001,
    East  = 0b00000010, 
    Lne   = 0b00000011,
    South = 0b00000100,
    Vline = 0b00000101,
    Lse   = 0b00000110,
    Tnw   = 0b00000111, 
    West  = 0b00001000,
    Lnw   = 0b00001001,
    Hline = 0b00001010,
    Tns   = 0b00001011,
    Lsw   = 0b00001100,
    Tne   = 0b00001101, 
    Tnn   = 0b00001110,
    Rose  = 0b00001111,
/* gray zone of compatiblity */
    Uarr  = 0b00010001,
    Larr  = 0b00010010,
    Darr  = 0b00010100,
    Rarr  = 0b00011000,
    Top   = 0b00011011,
    Bottom = 0b00011110,
    Diamond = 0b00011111,
    
}Symbol;

void Sym(Symbol,Let,Let,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
typedef enum Key {
    Any,
    Esc,
    K1, K2, K3, K4, K5, K6, K7, K8, K9, K0, Back,
    Kq, Kw, Ke, Kr, Kt, Ky, Ku, Ki, Ko, Kp,
      Ka, Ks, Kd, Kf, Kg, Kh, Kj, Kk, Kl, Enter,
    Kshift,   Kz, Kx, Kc, Kv, Kb, Kn, Km,
                   	Space,            Up, 
	                              Lt, Dn, Rt,
    Click,
    Keys
}Key;
//button   button
int Btn(Key);
int Mx();
int My();
//tick wait for the next tick, and keep in sync with Fps
#define Fps 60;
void Tck();

/* BANG
   beat
    audio
     nun?
      generator
*/

/* BDSM
   base
    data
     saving
      management
 */
