title: My loop isn't working well in this little game I just create
body: <p>I'm recently introducing myself to C programming. I've tried in the past with web developing, like html or css, but not really deeper. Well, I'm learning from a book about C programming. I see a dice game, and tried to emulate it just for fun and learning how it works, but didn't work well(My intention was that if lifeGohan or lifeJoel gets to '0' it stops. Just like one die, and 'the battle' stops.). I'm not following any guide for this specific game I just created. So, I'm just trying many things without good results.
  Can you give me some pieces of advice, please?</p>
  <p>This is my code in Tried N°1</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;time.h&gt;
  #include &lt;ctype.h&gt;
  
  main()
  {
      int attackJoel, attackGohan, lifeJoel, lifeGohan, KO;
      time_t t;
      
      srand(time(&amp;t));
      
      lifeGohan=20;
      lifeJoel=20;
      
      printf(&quot;Actual Life Joel: %d\tActual Life Gohan: %d\n&quot;, lifeJoel, lifeGohan);
      
      do
      {
          attackJoel=(rand() % 6)+1;
          attackGohan=(rand() % 6)+1;
          
          lifeJoel=lifeJoel-attackGohan;
          lifeGohan=lifeGohan-attackJoel;
          
          printf(&quot;\nActual Life Joel: %d\tActual Life Gohan: %d\n&quot;, lifeJoel, lifeGohan);
      }
      while((lifeJoel&gt;0) || (lifeGohan&gt;0));
  }
  
  </code></pre>
  <p>Tried N°2</p>
  <pre><code>main()
  {
      int attackJoel, attackGohan, lifeJoel, lifeGohan, KO;
      time_t t;
      
      srand(time(&amp;t));
      
      lifeGohan=20;
      lifeJoel=20;
      
      printf(&quot;Actual Life Joel: %d\tActual Life Gohan: %d\n&quot;, lifeJoel, lifeGohan);
      
      do
      {
          attackJoel=(rand() % 6)+1;
          attackGohan=(rand() % 6)+1;
          
          lifeJoel=lifeJoel-attackGohan;
          lifeGohan=lifeGohan-attackJoel;
          
          printf(&quot;\nActual Life Joel: %d\tActual Life Gohan: %d\n&quot;, lifeJoel, lifeGohan);
  
          if((lifeJoel&lt;=0) || (lifeGohan&lt;=0))
          {
              KO=0;
          }
      }
      while(KO==0);
  }
  
  </code></pre>