Skip to content

Conversation

@Ekarry
Copy link
Owner

@Ekarry Ekarry commented May 14, 2021

No description provided.

import java.util.Random;

public class JustDoIt {
public JustDoIt() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зачем тут конструктор?

Lesson1.Actions[] actions = new Lesson1.Actions[3];
int distance = rand.nextInt(10);
int heigth = rand.nextInt(10);
actions[0] = new Lesson1.Human("Peter", distance, heigth);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

классы можно импортировать, чтобы не дергать Lesson1.Human

if (!result) {
break;
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

отличное решение. Вы догадались что у класса, символизирующего препятствие должен быть один метод, который будет переопределен в конкретной реализации. Пока лучшее решение

} else {
barriers[i] = new Lesson1.Wall(i + 1 + " is Wall", distance);
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

по организации кода замечание - метод main у нас должен отражать соревнование. Поготовка данных тут занимает больше места чем непосредственно решение, можно вынести в отдельные методы
generateBarriers, generateParticipants

Ekarry added 2 commits May 18, 2021 22:36
Откорректировала по замечаниям - не смогла только по барьерам
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants