Hello,
I'm confused what the reason none of the tests are passed is.
Maybe I do not understand the conditions. Any, even small tip really appreciated.
Regards.
package com.codegym.task.task21.task2113;
import java.util.ArrayList;
import java.util.List;
public class Hippodrome {
private List<Horse> horses;
static Hippodrome game;
// static int movecounter = 0;
// static int printcounter = 0;
public static void main(String[] args) throws Exception {
if ( game == null ) {
game = new Hippodrome();
game.horses = new ArrayList<Horse>();
game.horses.add(new Horse("h1",3,0));
game.horses.add(new Horse("h2",3,0));
game.horses.add(new Horse("h3",3,0));
} else {
Horse h = new Horse("h1",3,0);
game.horses.add(h);
h = new Horse("h2",3,0);
game.horses.add(h);
h = new Horse("h3",3,0);
game.horses.add(h);
}
Hippodrome.game.run();
// System.out.println("counter for move: " + movecounter + " counter for print : " + printcounter);
}
public static void run() throws Exception {
int cnt = 1;
while ( cnt <= 100 ) {
Hippodrome. move();
Hippodrome. print();
Thread.sleep(200);
cnt++;
}
}
public static void move() {
System.out.println("move");
// Hippodrome.movecounter++;
}
public static void print() {
System.out.println("print");
// Hippodrome.printcounter++;
}
public Hippodrome() {
// this.horses = horses;
}
public List<Horse> getHorses() {
return horses;
}
}