diff options
| -rw-r--r-- | README.md | 4 | ||||
| -rw-r--r-- | src/Potato.java | 25 | ||||
| -rw-r--r-- | src/Tuber.java | 3 |
3 files changed, 19 insertions, 13 deletions
@@ -7,8 +7,8 @@ If you fork this then you can say you forked a potato. Forking potatoes is an ancient and well-manered tradition. -The potato first appeared in peru about ten thousand years ago. The potato was an early food source, and likely a highly traded good in early South America. Having been traded for several thousand years, and enduring much artifical selection, the explorers of the sixteenth and seventeenth century brought the potato back to Europe, where the crop grew. Originally thought to be poisonous and evil, the crop didn't become a major food for another hundred years. +The potato first appeared in Peru about ten thousand years ago. The potato was an early food source, and likely a highly traded good in early South America. Having been traded for several thousand years, and enduring much artifical selection, the explorers of the sixteenth and seventeenth century brought the potato back to Europe, where the crop grew. Originally thought to be poisonous and evil, the crop didn't become a major food for another hundred years. By the time potatoes were introduced into Europe, the fork was already prevelant. Hence, started the tradition of forking the potato. -You too can coninue this tradition of forking potatoes in the modern age by clicking the button above labeled "fork." +You too can continue this tradition of forking potatoes in the modern age by clicking the button above labeled "fork." diff --git a/src/Potato.java b/src/Potato.java index 51167de..399cdda 100644 --- a/src/Potato.java +++ b/src/Potato.java @@ -1,30 +1,29 @@ import java.util.List; import java.util.ArrayList; -public class Potato { +public class Potato implements Tuber { private final List<Condiment> condiments = new ArrayList<Condiment>(); public static void main(String[] args) { Potato potato = new Potato(); - Glados glados = new Glados(); + GLaDOS glados = new GLaDOS(); if (potato.prepare()) System.out.println("Of course potato is prepared and delicious."); - else System.out.println("Fatal error! How could potato not be delicious?"); + else System.err.println("Fatal error! How could potato not be delicious?"); } public boolean prepare() { - this.addCondiment("sour cream"); - this.addCondiment("chives"); - this.addCondiment("butter"); + this.addCondiments("sour cream", "chives", "butter"); return this.isDelicious(); } - public void addCondiment(String name) { + public void addCondiments(String... names) { synchronized (condiments) { - condiments.add(new Condiment(name)); + for (String condimentName : names) condiments.add(new Condiment(condimentName)); } } + @Override public boolean isDelicious() { return true; // obviously, potatos are always delicious } @@ -41,10 +40,14 @@ public class Potato { } } - private static class Glados extends Potato { - public Glados() - { + private static class GLaDOS extends Potato { + public GLaDOS() { System.out.println("Oh hi, how are you holding up? BECAUSE I'M A POTATO... clap clap clap... oh good, my slow clap processor made it into this thing, at least we have that."); } + + @Override + public boolean isDelicious() { + return false; // robots are not delicious + } } } diff --git a/src/Tuber.java b/src/Tuber.java new file mode 100644 index 0000000..ec36f28 --- /dev/null +++ b/src/Tuber.java @@ -0,0 +1,3 @@ +public interface Tuber { + public boolean isDelicious(); +} |
