Skip to content

Commit

Permalink
Fixed minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
gx-huang committed Feb 1, 2020
1 parent 4a0115f commit c3bd8a5
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
9 changes: 7 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import org.gradle.api.plugins.internal.DefaultJavaApplication
import org.gradle.internal.jvm.Jvm

plugins {
id 'java'
id 'application'
id 'checkstyle'
}

checkstyle {
toolVersion = '8.23'
}

group 'seedu.duke'
Expand All @@ -13,8 +19,7 @@ repositories {
}

final def application = application {
// Change this to your main class.
mainClassName = "Duke.class"
mainClassName = "Launcher"
}
application

Expand Down
1 change: 1 addition & 0 deletions data/tasks.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
D/dividefalse/dividethis/divide1997-08-08
8 changes: 2 additions & 6 deletions src/main/java/Duke.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public class Duke extends Application {
private UserText tasks;
private DukeParser parser;

public Duke(String filePath) throws DukeException {
DukeUI.showWelcomeMessage();
public Duke() {
String filePath = "data/tasks.txt";
storage = new DukeStorage(filePath);
tasks = storage.readText();
parser = new DukeParser(this.tasks);
Expand All @@ -22,10 +22,6 @@ public void run() {
storage.saveTasks(tasks);
}

public static void main(String[] args) throws DukeException {
new Duke("data/tasks.txt").run();
}

@Override
public void start(Stage stage) {
Label helloWorld = new Label("Hello World!"); // Creating a new Label control
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
public class Launcher {
public static void main(String[] args) {
Application.launch(Duke.class, args);
Duke duke = new Duke();
duke.run();
}
}

2 changes: 1 addition & 1 deletion src/main/java/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public boolean isDone() {
}

public String getStatusIcon() {
return (isDone ? "\u2713" : "\u2718"); //return tick or X symbols
return (isDone ? "O" : "X"); //return tick or X symbols
}

public String getDescription() {
Expand Down
Empty file added src/test/java/ToDoTest.java
Empty file.

0 comments on commit c3bd8a5

Please sign in to comment.