diff --git a/README.md b/README.md index 437e760..8af19b7 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ An exercise for collaborating with git / GitHub. Please read the directions CARE ``` This will tell git to perform fast forwards when possible, never rebase, and create merge commits when necessary. We will not cover the differences between these in-depth in class, but feel free on your own time to research them using search engines or AI if you're interested. Explore your curiosity! -## Setup project -1. Choose one partner to be Partner A, one partner to Partner B. +## Setup project (Another Change) +1. Choose one partner to be Partner A, one partner to Partner B. (Change made) 1. Have ONLY Partner A fork this repository. PARTNER B SHOULD NOT FORK. 1. Have Partner A add Partner B as a collaborator on their fork. Follow [these directions](https://docs.github.com/en/enterprise-server@3.10/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-access-to-your-personal-repositories/inviting-collaborators-to-a-personal-repository#inviting-a-collaborator-to-a-personal-repository). 1. Have the Partner A send the URL of their repository to Partner B. @@ -32,7 +32,7 @@ We will first practice making changes that do not trigger a merge conflict. In g ``` git pull ``` - 1. Make any change to the README and save it. + 1. Make any change to the README and save it. (Changes) 1. Check that the change shows up in red (shows as unstaged) when asking for the status. ``` git status @@ -67,7 +67,7 @@ We will now artificially trigger a merge conflict. When we follow good git pract 1. Have BOTH Partner A and Partner B edit the below line. Each person should make it say something different. ``` - EDIT THIS LINE + Line Edited ``` 1. Have BOTH Partner A and Partner B add, commit, and push the changes. You can refer to the above steps for a refresher on how to add/commit/push. One of the partners will get an error saying that their changes can't be pushed. This is OK and expected. Today we are practicing how to resolve this error. 1. Have the error partner pull the other partner's changes: diff --git a/src/Deer.java b/src/Deer.java new file mode 100644 index 0000000..a46c7b4 --- /dev/null +++ b/src/Deer.java @@ -0,0 +1,18 @@ +class Deer implements Animal +{ + public String getAnimalArt() + { + return " \\ ( )\n" + + " \\ `--(_ _)--\'\n" + + " \\ Y-Y\n" + + " \\ /@@ \\\n" + + " \\ / \\\n" + + " `--\'. \\ ,\n" + + " | `.__________/)"; + } + + public String toString() + { + return "deer"; + } +} diff --git a/src/Dog.java b/src/Dog.java new file mode 100644 index 0000000..e886061 --- /dev/null +++ b/src/Dog.java @@ -0,0 +1,37 @@ +/** + * The Dog class represents a dog and provides its ASCII art representation. + * This class implements the Animal interface and overrides the getAnimalArt + * and toString methods. + * + * dog art sourced from https://www.asciiart.eu/animals/birds-water + */ +class Dog implements Animal +{ + /** + * Returns the ASCII art representation of the dog. + * + * @return A string containing the ASCII art of the dog. + */ + @Override + public String getAnimalArt() + { +//By Maija Haavisto https://www.asciiart.eu/animals/dogs + +return " \\ .\n" + + " \\ ..^____/\n" + + " `-. ___ )\n" + + " || ||\n"; + } + + /** + * Returns the name of the animal ("Dog"). + * This method overrides the toString method to return the name of the dog. + * + * @return The string "dog" representing the name of the animal. + */ + @Override + public String toString() { + return "dog"; + } + } + \ No newline at end of file diff --git a/src/SayApp.java b/src/SayApp.java index 9d3bbf7..7da051a 100644 --- a/src/SayApp.java +++ b/src/SayApp.java @@ -76,7 +76,7 @@ public static Animal getAnimalChoice(Scanner scanner) { * @return A list of Animal objects. */ public static List animalList() { - return Arrays.asList(new Cow(), new Duck()); + return Arrays.asList(new Cow(), new Duck(), new Deer(), new Dog()); } /**