title: Two pennants moving one pixel at a time (racing) towards the finish line with a random probability?
body: <p>Just like in the title. I am trying to follow the online resources for Penn's CIS 110 class and teach myself basic programming skills during the summer but I am already having issues with the first problem set.</p>
  
  <p>Essentially, I am supposed to write a program where two pennants will move randomly and independently towards the finish line.</p>
  
  <p>I know the independent movement means that there are four cases</p>
  
  <p>a) the first pennant moves, but the second one doesn't.</p>
  
  <p>b) the second one moves, but the first one doesn't.</p>
  
  <p>c) Both move.</p>
  
  <p>d) Neither moves.</p>
  
  <p>Once one pennant crosses the finish line, the animation should stop, and my program should draw text in the window indicating which pennant won.</p>
  
  <p>What I have so far is position my start and finish line, and my pennants but I am not sure how to make the pennants move along the straight line with a random probability?</p>
  
  <p>Any help would be much appreciated since I am pretty much clueless on how to go about animating them. This what I have so far:</p>
  
  <pre><code>    boolean pennWins = false; //has penn won the race?
      boolean princetonWins = false; //has princeton won the race
  
      PennDraw.setCanvasSize(512, 512);
  
      double rx = 0.15, ry = 0.8, rz = .2;
  
  
      PennDraw.enableAnimation(10);
  
  
       while (!pennWins &amp;&amp; !princetonWins) {
          PennDraw.clear();
          PennDraw.setPenColor(PennDraw.BLACK);
          PennDraw.setPenRadius(.005);
          PennDraw.line(.03, 0, .03, 1);
          PennDraw.line(.65, 0, .65, 1); 
          PennDraw.picture(rx, ry,"penn.png");
          PennDraw.picture(rx, rz,"princeton.png");
  </code></pre>