#include "spec.h"

void Debug(Co co)
{
    for (int i=0; i<26; i++)
    if (Pressed(co,'a'+i))
    CuSPlot(co, 'a'+i, 1+i, 0, T);
    else
    CuSPlot(co, ' ', 1+i, 0, T);
}

void Render(Co co){
    CuRefresh(co,co->spr.x, co->spr.y, co->spr.w, co->spr.h);
}

void User(Co co, Routine next){
    Routine routines[] = {
        Debug,
        Render,
        Wait,
        Control,
        SSFlush,
        0
    };
    Deed(co,routines);
    if (!Pressed(co,'q'))
    Next(co,next);
}

Let Collide(Co co,Let first, Let second){
    if (SCol(co,first) == SCol(co,second))
    if (SRow(co,first) == SRow(co,second))
    return 1;
    return 0;
}

struct Continuation build(){
   	struct Continuation co;
    // collection
    //for (Let i=0; i<MAX;i++)
    //for (Let j=0; j<MAX;j++)
    //co.llection[i][j] = 0;
    // constant pointers
    //for (Let k=0; k<MAX;k++)
    //co.nstant[k] = 0;
    // event
    for (Let i=0;i<MAX;i++)
    co.mmission[i]=0;
    // sprites
    co.spr = SNew();
    for (Let i=0;i<peeps;i++)
    {
    co.peeps.hlt[i] = 0;
    co.peeps.mmt[i] = 0;
    }
    // time
    co.lastTick=0;
    co.lock=0;
    return co;
}

int main(){

    struct Continuation co = build(); 
    Routine routines[] = {
        CuInit,
        Spiel,
        CuExit,
        0
    };
    Deed(&co, routines);
    return 0;
}
