Deutsch   English   Français   Italiano  
<46766e2699a76a0336d5d49c442a2b2de2964070@i2pn2.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!news.nk.ca!rocksolid2!i2pn2.org!.POSTED!not-for-mail
From: fir <profesor.fir@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: logically weird loop
Date: Wed, 20 Nov 2024 18:38:00 +0100
Organization: i2pn2 (i2pn.org)
Message-ID: <46766e2699a76a0336d5d49c442a2b2de2964070@i2pn2.org>
References: <0e1c6d2e74d44a715bf7625ca2df022d169f878a@i2pn2.org>
 <vhl32r$66a2$1@dont-email.me>
 <df2c4dd068f2eb05132d61d12b37228faa46dffe@i2pn2.org>
 <fbe6358f0891b9257d731a66633b80c2b31606dc@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 20 Nov 2024 17:38:05 -0000 (UTC)
Injection-Info: i2pn2.org;
	logging-data="3380401"; mail-complaints-to="usenet@i2pn2.org";
	posting-account="+ydHcGjgSeBt3Wz3WTfKefUptpAWaXduqfw5xdfsuS0";
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:91.0) Gecko/20100101
 Firefox/91.0 SeaMonkey/2.53.19
X-Spam-Checker-Version: SpamAssassin 4.0.0
In-Reply-To: <fbe6358f0891b9257d731a66633b80c2b31606dc@i2pn2.org>
Bytes: 2307
Lines: 35

fir pisze:
> void ProcessMicroturnsUntilHuman()
>    {
>       if( game_time < character[HUM].action_end)
>       {
>        while(game_time < character[HUM].action_end)
>        {
>            DispatchActions();
>             game_time++;
>        }
>        if(game_time == character[HUM].action_end)     //**
>           DispatchActions();
>       }
> 
>    }

so the loop code in simplification look like

      if( game_time < 300) //this is only to not alllow re-enter the 
loop if you reach turn 300
      {
       while(game_time < 300) //game time starts form 0
       {
           DispatchActions();
            game_time++;
       }
          DispatchActions();  //this runs for turn 300
      }

im not sure if there is no bug here as when i press space and 300
turns into 600 then the dispatch on turn 300 would be executed
second time (?) (though in present state of things it wouldnt spoil
probably the things as dispatch if called on turn 300 starters would 
change the values and they woil not fiore twice

but it all show trubles in what should be 'simple' loop