title: "void" problem: program to simulate a virus
body: <p>i'm trying to simulate a virus for a school project. Basically, in a 50*50 matrix, called <code>island</code>
  there are randomized things: there may be a person (<code>x</code>), if there is, he may be infected(<code>p</code>) or not. Then, they might get infected, if they don't use protections. Of course, they also might get immune by getting cures (<code>i</code>).
  The &quot;infecting&quot; program is called <code>infecter()</code>; the immune one is called <code>medic()</code>.</p>
  <p>Here comes the problem: the last program i call ( this happens with <code>infecter()</code>, <code>medic()</code>) will not do everything i want it to do. In fact, if the last is <code>medic()</code>, i won't be able to tell if i want to get medics in the island; if the last one is <code>infecter()</code>, it will infect, but i won't be able to tell if the people are using facemasks, ecc.</p>
  <pre><code>//INFECTER
  void infecter()
  { //prog to infect ppl: if there are 2 pos close to the person, 50%; if there arent, 20%;
      //
      [... full of surely bad indented and still working stuff...]
  }
  
  //MEDIC
  void medic()
  { //program to save ppl==&gt; 25% of possiblities to get no longer virus'd
     [full of badly indented but working stuff]
  
      printf(&quot;\n***************************************************\n&quot;);
      //
  
     
  
      infecter();
      medic();
      printf(&quot;\n&quot;);
      
      return 0;
  }
  </code></pre>
  <p>P.S.:
  i worked like this, to create <code>void</code>s: i wrote code in <code>main()</code> function, and then copy pasted it into a <code>void</code> one, trying obviously to make it work.
  Thanks to everyone who tries to help me...</p>
  <p>EDITED:
  as i saw comments that told me that this is too much code, i'll put it in another way.
  <code>infecter()</code> and <code>medic()</code> surely work. They worked before this problem, and still do their job. The problem is: why don't they work completelly when they are called at the end of <code>main()</code> function?</p>
  <p>EDITED PART TWO:
  i'm shocked, everything works ok if i just put <code>medic()</code> before <code>infected()</code>. But then <code>medic()</code>wouldn't make sense (medics would help and save just rly little  infected, basically...)
  so i tried to call it before and after, like this:</p>
  <pre><code>medic();
  printf(&quot;\n&quot;);
  infecter();
  printf(&quot;\n&quot;);
  fake();
  printf(&quot;\n&quot;);
  medic();
  </code></pre>
  <p>now <code>infecter()</code> doesn't work properly.</p>