-
Notifications
You must be signed in to change notification settings - Fork 200
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
[waiter-palypoo] ip #193
Open
waiter-palypoo
wants to merge
31
commits into
nus-cs2113-AY2223S2:master
Choose a base branch
from
waiter-palypoo: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
[waiter-palypoo] ip #193
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
7faa1cb
Add HinaBot.java
waiter-palypoo 0e9f153
Refactor greeting message and add handleCommand method to echo user i…
waiter-palypoo 565a8e1
Add code for adding items to a list and printing the list
waiter-palypoo 3d00890
Add Task class, add code to mark and unmark tasks
waiter-palypoo 7e758c3
Add support for todo, deadline and event task types.
waiter-palypoo e13adce
no message
waiter-palypoo 752a280
Merge commit '7e758c3a91d41d43006c379c502de1ceb83a4e1f' into HEAD
waiter-palypoo c47e253
Resolved error resulting from RCS mistake
waiter-palypoo e40dfd0
Add code to handle unknown command, insufficient detail exceptions.
waiter-palypoo 203f936
Merge branch 'branch-Level-5'
waiter-palypoo 367c9fd
Divide classes into packages
waiter-palypoo 65eef30
Add method to delete tasks, fixed coding standard violations, change …
waiter-palypoo c890a60
Add functionality to save task list to a .txt file.
waiter-palypoo 07e9a22
Merge branch 'branch-Level-6'
waiter-palypoo 1071390
Merge branch 'branch-Level-7'
waiter-palypoo 3b7e16a
Refactor functionality into Parser, Ui, Storage and TaskList classes.
waiter-palypoo b0dc677
Add date-time format support
waiter-palypoo 2f02a85
Add method to search for items by matching substrings in Task descrip…
waiter-palypoo 0e9aa9a
Merge pull request #1 from waiter-palypoo/branch-Level-8
waiter-palypoo 4af6cef
Merge branch 'master' of https://github.com/waiter-palypoo/ip
waiter-palypoo da2844c
Merge branch 'master' into branch-Level-9
waiter-palypoo 4c64d87
Merge pull request #2 from waiter-palypoo/branch-Level-9
waiter-palypoo bf6fe2d
Merge branch 'master' of https://github.com/waiter-palypoo/ip into br…
waiter-palypoo 4e01561
Merge branch 'branch-Level-9'
waiter-palypoo ecce69f
Optimise imports for Deadline and Event classes
waiter-palypoo 019af43
Add JavaDoc comments for multiple classes and methods. Refactor some …
waiter-palypoo c915504
Merge pull request #3 from waiter-palypoo/branch-A-JavaDoc
waiter-palypoo b195b1d
Merge branch 'master' of https://github.com/waiter-palypoo/ip
waiter-palypoo 5a621ec
Updated user guide, changed find method to print the index of matchin…
waiter-palypoo 29dcae7
Fix bugs involving invalid inputs for mark, unmark and delete methods
waiter-palypoo d207461
Build jar file
waiter-palypoo 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
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,6 +1,8 @@ | ||
import java.util.Scanner; | ||
|
||
public class HinaBot { | ||
protected static String[] taskList = new String[100]; | ||
protected static int taskCount = 0; | ||
public static void main(String[] args) { | ||
String line; | ||
Scanner in = new Scanner(System.in); | ||
|
@@ -17,12 +19,28 @@ private static void showGreeting() { | |
} | ||
|
||
public static void handleCommand(String command) { | ||
if (!command.equalsIgnoreCase("bye")) { | ||
System.out.println(command); | ||
} | ||
else { | ||
if (command.equalsIgnoreCase("bye")) { | ||
System.out.println("Goodbye master, let's meet again soon..."); | ||
System.exit(0); | ||
} | ||
else if (command.equalsIgnoreCase("list")) { | ||
listTasks(); | ||
} | ||
else { | ||
addTask(command); | ||
} | ||
} | ||
|
||
public static void addTask(String task) { | ||
taskList[taskCount] = task; | ||
taskCount++; | ||
System.out.println("added: " + task); | ||
} | ||
|
||
public static void listTasks() { | ||
for (int i = 0; i < taskCount; i++) { | ||
System.out.print(i + 1); | ||
System.out.println(". " + taskList[i]); | ||
} | ||
} | ||
} | ||
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. Nice! No Coding Violations 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. Good job! |
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.
Nice!