"Oh, and display 10 empty lines after the loop (using System.out.println()) to make it more beautiful.". Seems to be simple, but I seems to misunderstand the problem. Please help me.
package com.codegym.task.task21.task2113;
import java.util.List;
import java.util.ArrayList;
import java.lang.InterruptedException;
public class Hippodrome {
private List<Horse> horses = new ArrayList<>();
public static Hippodrome game;
public Hippodrome(List<Horse> horses) {
this.horses = horses;
}
public static void main(String [] args) {
List<Horse> horses = new ArrayList<>();
horses.add(new Horse("Blacky", 3, 0));
horses.add(new Horse("SilverStar", 3, 0));
horses.add(new Horse("Goldy", 3, 0));
game = new Hippodrome(horses);
}
public List<Horse> getHorses() {
return horses;
}
public void run() {
try {
for (int i = 0; i < 100; i++) {
move();
print();
Thread.sleep(200);
}
}
catch (InterruptedException e) {}
}
public void print() {
horses.get(0).print();
horses.get(1).print();
horses.get(2).print();
for (int i = 0; i < 10; i++)
System.out.println();
}
public void move() {
horses.get(0).move();
horses.get(1).move();
horses.get(2).move();
}
}