Plan 9 from Bell Labs’s /usr/web/sources/contrib/paurea/goban/trymove.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#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);
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].