Skip to content

Commit

Permalink
Merge pull request #48 from Andy123qq4/master
Browse files Browse the repository at this point in the history
Fix checker and bug
  • Loading branch information
Andy123qq4 authored Apr 4, 2024
2 parents 026220e + c68c895 commit e4b4efe
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/main/java/seedu/duke/Checker.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void getUserAnswer() {
for (int i = 0; i < test.getNumber(); i++) {
Problem problem = test.getProblem().get(i);
ui.print(problem.unsolved());
// userInput = ui.readCommand();
userInput = ui.readCommand();
userAnswer[i] = userInput;
double answer = Double.NEGATIVE_INFINITY;
try {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/duke/Problem.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public Problem(String description, double answer) {
}

public String solved() {
return description + '=' + answer;
return description + " = " + answer;
}

public String unsolved() {
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/seedu/duke/Record.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ public Record(LocalDateTime dateTime, double speed, double accuracy, ArrayList<P
setPsIndex(psIndex);
}

// public void print(boolean showProbDetails) {
// ui.printRecords(showProbDetails, this);
// }

public void print(boolean showProbDetails) {
// ui.printRecords(showProbDetails, this);

System.out.println("Date Time: " + getDateTime().format(formatter));
System.out.println("ProblemSet ID: " + getPsIndex());
if (showProbDetails) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/seedu/duke/Ui.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package seedu.duke;

import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Scanner;
import java.time.format.DateTimeFormatter;
/**
* Represents the user interface for interacting with the chatbot.
*/
public class Ui {

// Pre-defined sentences
// private static final String PROBLEM_FORM =
// "To generate a problem set: Input the number and difficulty like below: \n" +
// "< generate -t [type] -n [number] -d [maximum digit] -l [length of formula] >";
private static final String PROBLEM_FORM =
"To generate a problem set: Input the number and difficulty like below: \n" +
"< generate -t [type] -n [number] -d [maximum digit] -l [number of operands] >";
private static final String INPUT_INSTRUCTION =
"Input Instructions:\n" +
"[operators]: can be + - * /, you can combine any of them.\n" +
Expand Down

0 comments on commit e4b4efe

Please sign in to comment.