package tunbridge;

import java.lang.InterruptedException;
import java.lang.Thread;

public class Main {
    public static void main(String[] args) {
        Bridge bridge = new Bridge();

        cross(new SouthBoundFarmer(bridge));
        cross(new NorthBoundFarmer(bridge));
    }

    private static void cross(Farmer f) {
        new Thread(f).start();
    }
}

@@ -81,28 +81,97 @@
 ad;%0A
-%0Apublic class Main %7B
+import java.util.Random;%0A%0Apublic class Main %7B%0A    final private static int FARMERS = 10;%0A
 %0A   
@@ -250,25 +250,24 @@
 idge();%0A
-%0A
         
 cross(ne
@@ -254,30 +254,252 @@
 ();%0A        
-cross(
+Random r = new Random();%0A%0A        System.out.println(%22Running with %22 + FARMERS + %22 farmers...%22);%0A        for (int i = 0; i %3C FARMERS; i++) %7B%0A            Farmer farmer;%0A            if (r.nextBoolean()) %7B%0A                farmer = 
 new SouthBou
@@ -510,25 +510,24 @@
 rmer(bridge)
-)
 ;%0A        cr
@@ -528,44 +528,126 @@
     
-cross(new NorthBoundFarmer(bridge));
+    %7D else %7B%0A                farmer = new NorthBoundFarmer(bridge);%0A            %7D%0A            cross(farmer);%0A        %7D
 %0A   

create a bunch of random farmers