|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T l
Length: 1537 (0x601) Types: TextFile Names: »loop.c«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987 └─⟦this⟧ »EUUGD18/X/Xgo/loop.c«
/* * $Header: loop.c,v 1.2 88/02/13 12:49:50 hale Exp $ */ /* Copyright 1987 Greg Hale Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. No representations are made about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ #include "go.h" #include <strings.h> extern int errno; extern int mesflg,curx,cury; Loop() { int mask,res; addmes("- GO By Greg Hale"); addmes("- Set up handicap."); addmes("- Press 'p' to play"); do { myturn = (!player && curplr) || (player && !curplr); if (!AreWe(HANDICAP)) { if (myturn) mvaddstr(0,0,"Your turn "); else mvaddstr(0,0,"Waiting for opponent"); } else { mvaddstr(0,0,"Set Handicap"); } if (mesflg) move(cury,curx); else moveto(cx,cy); refresh(); mask = sockmask[0] | sockmask[1]; if (select(32,&mask,0,0,0) == -1) { if (errno == EINTR) { continue; } else error(" Error- Select failed\n"); } if (mask & sockmask[0] == sockmask[0]) { DoLoop(); } else if (mask==sockmask[1]) { myturn = !myturn; DoOther(); refresh(); } else error(" Error - bad select\n"); } while (!AreWe(EXIT)); } /* * $Log: loop.c,v $ * Revision 1.2 88/02/13 12:49:50 hale * added logging. * */