Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Commit 16d4991

Browse files
committed
Reverted to old loop stopping code
1 parent 088e7ea commit 16d4991

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

src/convention2.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,15 @@ public int compare(cow arg0, cow arg1) {
3131
int mtime = -1,ctime;
3232
cow c2;
3333
boolean first =true;
34-
boolean runagain = false;
35-
for(int i = 0; i < time.size() || runagain; i ++) {
34+
for(int i = 0; i < time.size(); i ++) {
3635
if(theline.isEmpty()) {
37-
runagain = false;
3836
tc = time.get(i);// Short for the cow
3937
}else {
4038
System.out.println(tc.x +" " + tc.y +" "+ theline.get(0).x+" "+theline.get(0).y);
4139
c2 = theline.get(0);
4240
boolean nodouble = c2.equals(tc);
4341
if(nodouble) {
44-
//i --; // Make sure loop runs again
45-
runagain = true; // Better code
42+
i --; // Make sure loop runs again
4643
time.remove(c2); // Remove cow
4744
tc = theline.remove(0); // Let the waiting cow eat
4845
continue;
@@ -56,9 +53,7 @@ public int compare(cow arg0, cow arg1) {
5653
mtime = ctime;
5754
}
5855
}
59-
60-
//i --; // Make sure loop runs again
61-
runagain = true; // Better code
56+
i --; // Make sure loop runs again
6257
time.remove(c2); // Remove cow
6358
//senority.remove(theline.get(0));
6459
tc = theline.remove(0); // Let the waiting cow eat

0 commit comments

Comments
 (0)