Skip to content

Lab1#46

Open
kalllegar wants to merge 1 commit into
Rrenkens:mainfrom
kalllegar:lab-01
Open

Lab1#46
kalllegar wants to merge 1 commit into
Rrenkens:mainfrom
kalllegar:lab-01

Conversation

@kalllegar
Copy link
Copy Markdown

No description provided.

Comment thread lab-01/src/Main.java
public class Main {
public static void main(String[] argv) {
Map<String, Quiz> givenQuizzes = getQuizMap();
System.out.println("enter the name of the test:");
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

А как я его узнаю без кода?

Comment thread lab-01/src/Main.java
}
}
Formatter formatter = new Formatter();
formatter.format("%.1f", currentQuiz.getMark());
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

почему 1 знака достаточно?

Comment thread lab-01/src/Main.java
//TextTest usage
TextTask firstTextTask = new TextTask("what the best array sorting asymptotics?", "O(nlogn)");
TextTask secondTextTask = new TextTask("how many people are in our group?", "26");
TextTask thirdTextTask = new TextTask("the asymptotics with which the insertion into the map is performed?", "O(1)");
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

А это точно правда?

Task result = nextTask;
currentTask = nextTask;
if (taskCount > 1) {
nextTask = generator.generate();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Почему нам необходимо хранить текущую и следующую таску?

* @param tasks задания, которые передаются в конструктор в Collection (например, {@link LinkedList})
*/
public PoolTaskGenerator(boolean allowDuplicate, Collection<Task> tasks) {
LinkedHashSet<String> unique = new LinkedHashSet<>();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Зачем здесь LinkedHashSet? Почему обычный HashSet не подошел?

this.minNumber = minNumber;
this.maxNumber = maxNumber;
this.operations = operations.clone();
if (operations.equals(EnumSet.noneOf(MathTask.Operation.class))) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

isEmpty()?

.skip(pos)
.limit(1)
.findFirst()
.orElse(Operation.ADDITION);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Упасть на некорректных данных лучше, чем генерировать какие-то рандомные примеры, а еще лучше не упасть и сообщить об ошибке.

text = "The accuracy of answer must be no less then " + getaccuracyAsDoubleValue() + "\n" +
"x" + Operation.toChar(operation) + firstNumber + "=" + secondNumber;
if (doubleEqual(firstNumber, 0.0) && operation == Operation.DIVISION) {
answer = "invalid operation";
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

как я должен догадаться до такого ответа?

if (doubleEqual(firstNumber, 0.0) &&
doubleEqual(secondNumber, 0.0) &&
operation == Operation.MULTIPLICATION) {
answer = "there is no right answer";
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

И тут скорее лучше сказать, что все подходит

super(firstNumber, secondNumber, accuracy, operation);
text = "The accuracy of the answer must be at least " + getaccuracyAsDoubleValue() + "\n" +
firstNumber + Operation.toChar(operation) + secondNumber + "=?";
if (secondNumber == 0 && operation == Operation.DIVISION) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Почему тут без epsilon сравнение?

@Rrenkens
Copy link
Copy Markdown
Owner

Rrenkens commented Dec 21, 2022

Ну пока что такая оценка:

  • -0.05 за сравнение без epsilon.
  • -0.05 за ответ с одним знаком.
  • -0.2 за какие-то рандомные константы и разный precision.
  • -0.25 за хранение 2 тасок.
  • -0.35 за неинтуитивность интерефейса.
  • -0.75 за неоптимальную асимтотику.

Допы:

  • +1 за EnumSet.
  • +1 за nested class.
  • +3 за precision во всех его проявлениях.

В итоге 8.35, коэффициент 0.5 = 4.175. +5 за допы. Я подумаю, что делать с похожими работами.

@Rrenkens Rrenkens added the question Further information is requested label Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants