www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/25/14:17:14

From: xanathar AT videotron DOT ca
Newsgroups: comp.os.msdos.djgpp
Subject: Loop not doing what it should :( USES ALLEGRO
Date: Tue, 22 Jul 1997 15:37:38 GMT
Organization: VTL
Lines: 33
Message-ID: <33d4d348.10078649@news.videotron.ca>
NNTP-Posting-Host: 205.237.235.233
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hello fellow DJGPP'ers, I have a bit of code that does not exactly do
what I think IT should do. I think that the code should loop without
any user intervention but that does not seem to be the case. The
printf statement is only executed whenver I touch a key, I wanteds it
to be continous without key input, what am I doing wrong?

Sorry for teh following code snippet, but I'm at work now and don't
have the real code in front of me, but here is what it does

The "readkey" is an ALLEGRO function for reading keyboard input
CODE SNIPET

void main_loop(void)
{

 while (quit != 1)
 {
  readkey(...
  readkey(...
  readkey(...
  readkey(...
  readkey(...

  if (this and that) do this...
  if (this and that) do this...
  if (this and that) do this...

  printf("Depth: %d Heading: %d   Speed: %d\n",depth,heading,speed);
 } // end while loop
} //end function

Thanks!

- Raw text -


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