www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/08/13:49:28

From: Vic <tudor AT cam DOT org>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: loop'ing
Date: Sun, 08 Nov 1998 13:01:19 -0500
Organization: Communications Accessibles Montreal, Quebec Canada
Lines: 24
Message-ID: <3645DC6F.7F4F@cam.org>
References: <000601be0b21$cb57ae60$a4feffc2 AT default>
NNTP-Posting-Host: dialup-547.hip.cam.org
Mime-Version: 1.0
X-Mailer: Mozilla 3.0Gold (Win95; I)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Lazer ---¤--- wrote:
> 
> I need a function for looping until 'esc' is press'ed!
> my code look like this:
> 
> -----------------------------------------------
> again:
> 
>  /* the game code */
> 
>   if (key[KEY_ESC]) {
>       return 0;
>   }
> 
> goto again
> -----------------------------------------------
> 
> is there a better way of doing this?

why not try
while(!key[KEY_ESC])
{
do stuff
}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019