nanogui: Mine Game hangs on RTEMS
Subject:
Mine Game hangs on RTEMS
From:
Rosimildo daSilva ####@####.####
Date:
28 May 2000 14:56:20 -0000
Message-Id: <200005281456.HAA12350@www2.xoommail.com>
demos/mwin/mine.c
Around line 732:
srandom( time(NULL));
i = 0;
while( i < bombnum )
{
ran1 = random()%sg_boxnumx;
ran2 = random()%sg_boxnumy;
if(!bom[ran1][ran2].flag)
{
bom[ran1][ran2].flag = 1;
i++;
}
}
This code under RTEMS goes into infinite loop, and
it just hangs. I do not know exactly what it is
doing, but I replaced it with:
srandom( time(NULL));
i = 0;
while( i < bombnum )
{
ran1 = random()%sg_boxnumx;
ran2 = random()%sg_boxnumy;
if(!bom[ran1][ran2].flag)
{
bom[ran1][ran2].flag = 1;
}
i++;
}
and now the game runs. It looks like that the "random()"
routine under RTEMS is not quite "random", or the seed
passed to it causes it behaves like that.
Is this fix ok ?
Another question:
New keyboard mapping: -- I am trying to bring RTEMS
up to the latest version, and I saw some messages
about a full re-work of the keyboard handling a few weeks back.
At the time I was busy, I did not pay attention to the messages,
and now I am wondering where can I start. The reason
for that is that the FLTK demos do not accept any
keystroke from RTEMS.
Thanks, Rosimildo.
Thanks,
Rosimildo
______________________________________________________
Get your free web-based email at http://www.xoom.com
Birthday? Anniversary? Send FREE animated greeting
cards for any occasion at http://greetings.xoom.com