Skip to content

Commit d9e8b60

Browse files
authored
Merge pull request #1 from AY2324S1-CS2113-F11-3/master
Update forked repo
2 parents 54e78fc + 38bd633 commit d9e8b60

22 files changed

+302
-27
lines changed

docs/AboutUs.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# About us
22

3+
34
Display | Name | Github Profile | Portfolio
45
--------|:------------------:|:--------------:|:---------:
56
![](https://media.licdn.com/dms/image/C4D03AQGTLbALYjG82Q/profile-displayphoto-shrink_800_800/0/1580629728751?e=1701907200&v=beta&t=PEfw_qZfZA39rJRfo5_Pg4o_RmbPwdneiPX3ftNt9dA) | Wendelin Wemhoener | [Github](https://github.com/wendelinwemhoener/) | [Portfolio](docs/team/wendelinwemhoener.md)
6-
![](https://via.placeholder.com/100.png?text=Photo) | Don Joe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md)
7-
![](https://via.placeholder.com/100.png?text=Photo) | Ron John | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md)
8-
![](https://via.placeholder.com/100.png?text=Photo) | John Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md)
7+
![](https://via.placeholder.com/100.png?text=Photo) | Zhu Jingxi | [Github](https://github.com/Cheezeblokz) | [Portfolio](docs/team/zhujingxi.md)
8+
![](/Users/brian/Desktop/Colgate/NUS Fall 2023/CS2113/Team Project/docs/photo/kherlenbayasgalan.jpg) | Kherlen Bayasgalan | [Github](https://github.com/Brian030601) | [Portfolio](docs/team/kherlenbayasgalan.md)
9+
![](https://via.placeholder.com/100.png?text=Photo) | Bang Junhyeong | [Github](https://github.com/junhyeong0411) | [Portfolio](docs/team/bangjunhyeong.md)
910
![](https://via.placeholder.com/100.png?text=Photo) | Don Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md)

docs/photo/kherlenbayasgalan.jpg

1.27 MB
Loading

docs/team/bangjunhyeong.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Bang Junhyeong - Project Portfolio Page
2+
3+
## Overview
4+
5+
6+
### Summary of Contributions

docs/team/kherlenbayasgalan.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Kherlen Bayasgalan - Project Portfolio Page
2+
3+
## Overview
4+
5+
6+
### Summary of Contributions

docs/team/johndoe.md renamed to docs/team/zhujingxi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# John Doe - Project Portfolio Page
1+
# Zhu Jingxi - Project Portfolio Page
22

33
## Overview
44

src/main/java/seedu/duke/Duke.java

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
11
package seedu.duke;
22

3+
import seedu.duke.flashcard.Flashcard;
4+
import seedu.duke.flashcard.FlashcardComponent;
5+
6+
import java.util.ArrayList;
37
import java.util.Scanner;
48

59
public class Duke {
6-
/**
7-
* Main entry-point for the java.duke.Duke application.
8-
*/
10+
public Duke() {}
11+
912
public static void main(String[] args) {
10-
String logo = " ____ _ \n"
11-
+ "| _ \\ _ _| | _____ \n"
12-
+ "| | | | | | | |/ / _ \\\n"
13-
+ "| |_| | |_| | < __/\n"
14-
+ "|____/ \\__,_|_|\\_\\___|\n";
15-
System.out.println("Hello from\n" + logo);
16-
System.out.println("What is your name?");
17-
18-
Scanner in = new Scanner(System.in);
19-
System.out.println("Hello " + in.nextLine());
13+
new Duke().run();
14+
}
15+
16+
private void run() {
17+
FlashcardComponent fc = new FlashcardComponent(new ArrayList<Flashcard>());
18+
19+
Scanner scanner = new Scanner(System.in);
20+
String input;
21+
boolean shouldTerminate = false;
22+
23+
while (!shouldTerminate) {
24+
input = scanner.nextLine();
25+
26+
if (fc.isResponsible(input)) {
27+
fc.processInput(input);
28+
}
29+
}
30+
2031
}
2132
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package seedu.duke;
2+
3+
import java.io.File;
4+
import java.io.FileNotFoundException;
5+
import java.util.Scanner;
6+
7+
/**
8+
* storage for flashcards
9+
* Flashcard implementation should be finished first
10+
*/
11+
public class Storage {
12+
// simply implemented for save & load first
13+
14+
protected String path;
15+
16+
public Storage(String path){
17+
this.path = path;
18+
}
19+
20+
21+
public void loadFlashcards() throws FileNotFoundException{
22+
23+
File f = new File (this.path);
24+
Scanner s = new Scanner(f);
25+
26+
}
27+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package seedu.duke.flashcard;
2+
3+
import java.time.LocalDateTime;
4+
import java.util.ArrayList;
5+
6+
public class Flashcard {
7+
private String frontText;
8+
private String backText;
9+
private ArrayList<String> tags;
10+
private ArrayList<FlashcardReview> reviews;
11+
private LocalDateTime nextReviewOn;
12+
13+
public Flashcard(String frontText, String backText) {
14+
this.frontText = frontText;
15+
this.backText = backText;
16+
17+
tags = new ArrayList<>();
18+
reviews = new ArrayList<>();
19+
20+
nextReviewOn = null;
21+
}
22+
23+
public String toString() {
24+
return "-".repeat(80) + System.lineSeparator()
25+
+ "front text: " + frontText + System.lineSeparator()
26+
+ "back text: " + backText + System.lineSeparator()
27+
+ "tags: " + tags.toString() + System.lineSeparator()
28+
+ "next review due on: " + nextReviewOn + System.lineSeparator()
29+
+ "-".repeat(80);
30+
}
31+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package seedu.duke.flashcard;
2+
3+
import seedu.duke.flashcard.command.FlashcardCommand;
4+
import seedu.duke.flashcard.command.CreateFlashcardCommand;
5+
import seedu.duke.flashcard.command.ListFlashcardsCommand;
6+
import seedu.duke.flashcard.command.StartReviewCommand;
7+
import seedu.duke.flashcard.command.UnknownCommand;
8+
9+
public class FlashcardCommandParser {
10+
public FlashcardCommand parseInput(String input) {
11+
if (input.startsWith("create flashcard")) {
12+
return new CreateFlashcardCommand();
13+
} else if (input.startsWith("list flashcards")) {
14+
return new ListFlashcardsCommand();
15+
} else if (input.startsWith("start review")) {
16+
return new StartReviewCommand();
17+
}
18+
19+
return new UnknownCommand();
20+
}
21+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package seedu.duke.flashcard;
2+
3+
import seedu.duke.flashcard.command.FlashcardCommand;
4+
import seedu.duke.flashcard.command.UnknownCommand;
5+
6+
import java.util.ArrayList;
7+
8+
public class FlashcardComponent {
9+
private FlashcardCommandParser parser;
10+
private FlashcardList flashcardList;
11+
private FlashcardUi ui;
12+
13+
public FlashcardComponent(ArrayList<Flashcard> flashcards) {
14+
parser = new FlashcardCommandParser();
15+
flashcardList = new FlashcardList(flashcards);
16+
ui = new FlashcardUi(flashcardList);
17+
}
18+
19+
public boolean isResponsible(String input) {
20+
FlashcardCommand command = parser.parseInput(input);
21+
22+
if (command instanceof UnknownCommand) {
23+
return false;
24+
} else {
25+
return true;
26+
}
27+
}
28+
29+
public void processInput(String input) {
30+
FlashcardCommand command = parser.parseInput(input);
31+
ui.executeCommand(command);
32+
}
33+
}

0 commit comments

Comments
 (0)