-
Notifications
You must be signed in to change notification settings - Fork 434
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
[beefsausagee] iP #457
Open
alvislowyh
wants to merge
63
commits into
nus-cs2103-AY2324S2:master
Choose a base branch
from
alvislowyh:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[beefsausagee] iP #457
Changes from 3 commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
55f9f9f
docs/README.md: Tweak document template
f837ddb
Add Gradle support
a6f7324
Bump gradle and lib version
Eclipse-Dominator b19d562
Implement changes for Level-0
alvislowyh 85dcedc
Level 1
alvislowyh 8380b0e
Level-2
alvislowyh 98302d6
Level 3. Mark As Done
alvislowyh e597f5e
Level 3. Mark As Done
alvislowyh 22274ba
Level 4. ToDos, Events, Deadlines
alvislowyh e7c4c66
Level 5. Handle Errors
alvislowyh f5ba09f
Level 5. Handle Errors
alvislowyh 8031d99
Level 6. Delete
alvislowyh 676000f
Level 6. Delete
alvislowyh 6cd69dc
Text UI Testing
alvislowyh 2795a19
Level-7
alvislowyh d1ae4d1
Level 8
alvislowyh e09a661
Level 8
alvislowyh 9879c00
Implemented changes for MoreOOP
alvislowyh 7630968
Implemented changes for packages
alvislowyh 48daa44
Merge branch 'add-gradle-support'
alvislowyh c9b9ea9
Added JUnit Test for Deadline class and Event class
alvislowyh da7892d
Package the App as a JAR file
alvislowyh 51672c1
Add JavaDoc comments
alvislowyh eb187d4
Tweak the code to comply with a coding standard
alvislowyh d92ee08
Implement changes for Level-9
alvislowyh 847b1f8
Merge changes from branch-Level-9
alvislowyh 6b47835
Merge branch 'branch-Level-9'
alvislowyh e1dfcd8
Merge changes from branch-A-JavaDoc
alvislowyh 1a7fa85
Implement changes to Duke and Task
alvislowyh 08e649b
Implement changes to Duke
alvislowyh 882183b
Add comments to Ui and Duke
alvislowyh 49a2820
Merge branch 'branch-A-CodingStandard'
alvislowyh a514e94
Implement changes for Level 10
alvislowyh def0e91
Implement changes for Level-10
alvislowyh 8521af1
Add XiaoBai and User image
alvislowyh 0c57575
Change Duke to XiaoBai
alvislowyh af87374
Implement changes: Duke to XiaoBai
alvislowyh 986b26b
Implement changes for code quality
alvislowyh 456decf
Add assertions to improve input validation and error handling
alvislowyh ecbb3a0
Merge pull request #2 from beefsausagee/branch-A-Assertions
alvislowyh e3345b9
Add Javadoc comments to all classes in the project
alvislowyh 4f38f31
Merge pull request #3 from beefsausagee/branch-A-CodeQuality
alvislowyh 2972aaa
Removed txt file
alvislowyh d6e6b0f
Implement changes to tasks
alvislowyh e2495aa
Added extension C-Sort
alvislowyh 57dc2af
Merge pull request #4 from beefsausagee/branch-C-Sort
alvislowyh b0c3bae
Implemented separate methods for processing todo, deadline, event, ma…
alvislowyh 65484bd
Merge branch 'master' of https://github.com/beefsausagee/ip
alvislowyh 6e6c6e3
Implement changes to Storage, UI, XiaoBai
alvislowyh ee38c98
Implement changes to text outcome to include personality for XiaoBai
alvislowyh 782753b
Implemented changes to MainWindow.fxml to change design of GUI window
alvislowyh 4f0bc96
Implemented changes to README.md
alvislowyh ad10551
Implemented changes for assertions
alvislowyh 66f4897
Implemented changes to README.md
alvislowyh e256bc0
Implemented changes to README.md
alvislowyh edd5820
Implemented changes to runtest
alvislowyh 69c11da
Implemented changes to Storage
alvislowyh e69e059
Implemented changes to UG
alvislowyh 4169926
Add additional date and time formats
alvislowyh dd10ff6
Implement changes to parser
alvislowyh b79ce5f
Implement changes to Storage description
alvislowyh 96c70a1
Implement changes to Ui for personality
alvislowyh 8b620c5
Implement changes to XiaoBaiException to only display error message
alvislowyh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,73 @@ | ||
import java.io.BufferedReader; | ||
import java.io.IOException; | ||
import java.io.InputStreamReader; | ||
import java.util.ArrayList; | ||
|
||
public class Duke { | ||
public static void main(String[] args) { | ||
String logo = " ____ _ \n" | ||
+ "| _ \\ _ _| | _____ \n" | ||
+ "| | | | | | | |/ / _ \\\n" | ||
+ "| |_| | |_| | < __/\n" | ||
+ "|____/ \\__,_|_|\\_\\___|\n"; | ||
System.out.println("Hello from\n" + logo); | ||
private static final String LINE = "___________________________________________________________\n"; | ||
|
||
public static void main(String[] args) throws IOException { | ||
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); | ||
ArrayList<String> listOfStrings = new ArrayList<>(); | ||
boolean hasEnded = false; | ||
String botName = "Yube"; | ||
int counter = 1; | ||
|
||
greet(botName); | ||
while (!(hasEnded)) { | ||
String input = reader.readLine(); | ||
if (input.equals("bye")) { | ||
bye(); | ||
hasEnded = true; | ||
} else if (input.equals("list")) { | ||
printList(listOfStrings); | ||
} else { | ||
repeatFunction(input); | ||
listOfStrings.add(String.format("%s. %s\n", counter, input)); | ||
counter++; | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Displays a greeting message | ||
* | ||
* @param botName Name of the bot | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likewise, I think each parameter description should end with a fullstop. I noticed the same issue in several other places too. |
||
*/ | ||
public static void greet(String botName) { | ||
System.out.println(String.format( | ||
"%sHello! I'm %s \nWhat can I do for you? \n%s", LINE, botName, LINE)); | ||
} | ||
|
||
/** | ||
* Displays a farewell message | ||
*/ | ||
public static void bye() { | ||
System.out.println(String.format( | ||
"%sBye. Hope to see you again soon! \n%s", LINE, LINE)); | ||
} | ||
|
||
/** | ||
* Displays a repeated message of the input by the user | ||
* | ||
* @param input User input | ||
*/ | ||
public static void repeatFunction(String input) { | ||
System.out.println(String.format("%sadded: %s\n%s", LINE, input, LINE)); | ||
} | ||
|
||
/** | ||
* Displays the list of Strings | ||
* | ||
* @param listOfStrings list of Strings | ||
*/ | ||
public static void printList(ArrayList<String> listOfStrings) { | ||
StringBuilder finalString = new StringBuilder(); | ||
finalString.append(LINE); | ||
for (String c : listOfStrings) { | ||
finalString.append(c); | ||
} | ||
finalString.append(LINE); | ||
System.out.println(finalString.toString()); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think the sentence should end with a fullstop. I noticed the same issue in several other places too.