Skip to content
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# grcsay
An exercise for collaborating with git / GitHub. Please read the directions CAREFULLY! I recommend focusing on the changes to the README before reading the Java code.

## Find a Partner
Locate a partner for this exercise. Partners were found!

## Setting up git merging strategy
1. Each partner should run these commands on their own terminal. DO NOT SKIP THIS PART!!!
```
Expand Down Expand Up @@ -67,7 +70,11 @@ 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

Sidhu Moosewala

This line has been 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:
Expand Down
36 changes: 36 additions & 0 deletions src/Deer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* The deer class represents a deer and provides its ASCII art representation.
* This class implements the Animal interface and overrides the getAnimalArt
* and toString methods.
*
* Deer by https://www.asciiart.eu/animals/deer.
*/
class Deer implements Animal {

/**
* Returns the ASCII art representation of the deer.
*
* @return A string containing the ASCII art of the deer.
*/
@Override
public String getAnimalArt() {
return " \\ ( )\n" +
" \\ `--(_ _)--\'\n" +
" \\ Y-Y\n" +
" \\ /@@ \\\n" +
" \\ / \\\n" +
" `--\'. \\ ,\n" +
" | `.__________/)";
}

/**
* Returns the name of the animal ("deer").
* This method overrides the toString method to return the name of the deer.
*
* @return The string "deer" representing the name of the animal.
*/
@Override
public String toString() {
return "deer";
}
}
34 changes: 34 additions & 0 deletions src/Dog.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* The Dog class represents a cow and provides its ASCII art representation.
* This class implements the Animal interface and overrides the getAnimalArt
* and toString methods.
*
* By Maija Haavisto https://www.asciiart.eu/animals/dogs
*/
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() {
return " \\ .\n" +
" \\ ..^____/\n" +
" `-. ___ )\n" +
" || ||\n";

}

/**
* Returns the name of the animal ("dog").
* This method overrides the toString method to return the name of the cow.
*
* @return The string "dog" representing the name of the animal.
*/
@Override
public String toString() {
return "dog";
}
}
2 changes: 1 addition & 1 deletion src/SayApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static Animal getAnimalChoice(Scanner scanner) {
* @return A list of Animal objects.
*/
public static List<Animal> animalList() {
return Arrays.asList(new Cow(), new Duck());
return Arrays.asList(new Cow(), new Duck(), new Deer(), new Dog());
}

/**
Expand Down