Re: logically weird loop

Liste des GroupesRevenir à cl c  
Sujet : Re: logically weird loop
De : profesor.fir (at) *nospam* gmail.com (fir)
Groupes : comp.lang.c
Date : 20. Nov 2024, 18:38:00
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <46766e2699a76a0336d5d49c442a2b2de2964070@i2pn2.org>
References : 1 2 3 4
User-Agent : Mozilla/5.0 (Windows NT 10.0; WOW64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.19
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

Date Sujet#  Auteur
20 Nov 24 * logically weird loop32fir
20 Nov 24 +- Re: logically weird loop1fir
20 Nov 24 `* Re: logically weird loop30Janis Papanagnou
20 Nov 24  +* Re: logically weird loop4fir
20 Nov 24  i`* Re: logically weird loop3fir
20 Nov 24  i `* Re: logically weird loop2fir
21 Nov 24  i  `- Re: logically weird loop1fir
21 Nov 24  `* Re: logically weird loop25Lawrence D'Oliveiro
21 Nov 24   +* Re: logically weird loop21Janis Papanagnou
21 Nov 24   i+* Re: logically weird loop6fir
21 Nov 24   ii`* Re: logically weird loop5fir
21 Nov 24   ii `* Re: logically weird loop4Janis Papanagnou
21 Nov 24   ii  `* Re: logically weird loop3fir
21 Nov 24   ii   `* Re: logically weird loop2Janis Papanagnou
22 Nov 24   ii    `- Re: logically weird loop1fir
22 Nov 24   i+* Re: logically weird loop9Lawrence D'Oliveiro
22 Nov 24   ii+- Re: logically weird loop1Janis Papanagnou
22 Nov 24   ii`* Re: logically weird loop7Michael S
22 Nov 24   ii +* Re: logically weird loop2fir
22 Nov 24   ii i`- Re: logically weird loop1fir
5 Dec 24   ii `* Re: logically weird loop4Tim Rentsch
5 Dec 24   ii  `* Re: logically weird loop3Janis Papanagnou
5 Dec 24   ii   `* Re: logically weird loop2David Brown
5 Dec 24   ii    `- Re: logically weird loop1Janis Papanagnou
5 Dec 24   i`* Re: logically weird loop5Tim Rentsch
5 Dec 24   i `* Re: logically weird loop4Janis Papanagnou
7 Dec 24   i  `* Re: logically weird loop3Tim Rentsch
7 Dec 24   i   `* Re: logically weird loop2Keith Thompson
8 Dec 24   i    `- Re: logically weird loop1Kaz Kylheku
22 Nov 24   `* Re: logically weird loop3fir
22 Nov 24    `* Re: logically weird loop2fir
24 Nov 24     `- Re: logically weird loop1fir

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal