[choonkit-nus] iP#83
Open
choonkit-nus wants to merge 21 commits into
Open
Conversation
irving11119
reviewed
Sep 17, 2023
irving11119
left a comment
There was a problem hiding this comment.
Overall your code is quite readable and it follows the standards well. Just remember to leave appropriate blank lines when you have multiple lines grouped together.
Comment on lines
+7
to
+12
| String logo = " _ _ \n" | ||
| + " | | | | \n" | ||
| + " | | __ _| | _____ \n" | ||
| + " _ | |/ _` | |/ / _ \\\n" | ||
| + " | |__| | (_| | < __/\n" | ||
| + " \\____/ \\__,_|_|\\_\\___|\n"; |
There was a problem hiding this comment.
Perhaps you could make this a constant instead.
| System.out.println(logo); | ||
| System.out.println("Hello! I'm Jake"); | ||
| System.out.println("What can I do for you?"); | ||
| Scanner readIn = new Scanner(System.in); |
There was a problem hiding this comment.
It's better to use nouns as class names rather than verbs. So perhaps you could name this Scanner inputReader
Comment on lines
+70
to
+80
| int startIndex = userInput.indexOf("/from "); | ||
| int endIndex = userInput.indexOf("/to "); | ||
| String startTime = userInput.substring(startIndex + 6, endIndex); | ||
| String endTime = userInput.substring(endIndex + 4); | ||
| int descriptionIndex = userInput.indexOf(text[1]); | ||
| String description = userInput.substring(descriptionIndex, startIndex); | ||
| Task t = new Event(description, startTime, endTime); | ||
| botMemory.add(t); | ||
| System.out.println("Added the following task:"); | ||
| System.out.println(t.getDescription()); | ||
| System.out.println("Now there are " + Task.getTaskCount() + " tasks in the botMemory list!"); |
There was a problem hiding this comment.
Perhaps you could leave spaces in between statements to make your code more readable.
For example, you could add a line between your index variables and time variables.
Based on comments of PR review, Set logo to be a constant variable Edited readIn to inputReader (to use noun instead of verb for name convention of class)
This reverts commit be1a89e.
If the botMemory file does not exist, it then creates the "data" directory and "botMemory.txt" file
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.