#include <u.h>
#include <libc.h>
#include <draw.h>
#include <thread.h>
#include <igo.h>
void
threadmain(int, char **)
{
Move *m;
Move *grp;
Move *grp2;
int i;
grp = nil;
for(i = 0; i < 10; i++){
m = malloc(sizeof(Move));
fillmov(m, Pt(3,i), 'C');
grp = addmove(grp, m);
}
opgrp(grp, '\0', opprint);
dprint("Take last:");
m = takelast(&grp);
opgrp(m, '\0', opprint);
opgrp(grp, '\0', opprint);
dprint("Free last:\n");
grp = freelast(grp);
opgrp(grp, '\0', opprint);
grp = addmove(grp, m);
dprint("Add move:\n");
opgrp(grp, '\0', opprint);
grp2 = clonegrp(grp);
opgrp(grp2, 'W', opsettype);
dprint("Print grp:\n");
opgrp(grp, '\0', opprint);
dprint("Print grp2:\n");
opgrp(grp2, '\0', opprint);
dprint("popmov:\m");
grp = popmov(&m, grp);
opgrp(grp, '\0', opprint);
dprint("pushmov\m");
grp = pushmov(grp, m);
opgrp(grp, '\0', opprint);
}
|