-
Notifications
You must be signed in to change notification settings - Fork 0
Прошу проверить ДЗ1 #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| import java.util.Random; | ||
|
|
||
| public class JustDoIt { | ||
| public JustDoIt() { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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; | ||
| } | ||
| } |
There was a problem hiding this comment.
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); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
по организации кода замечание - метод main у нас должен отражать соревнование. Поготовка данных тут занимает больше места чем непосредственно решение, можно вынести в отдельные методы
generateBarriers, generateParticipants
Откорректировала по замечаниям - не смогла только по барьерам
No description provided.