|
|
@@ -1,14 +1,20 @@
|
|
1
|
|
-# Proverb in Java
|
|
|
1
|
+# Proverb
|
|
2
|
2
|
|
|
3
|
|
-For want of a horseshoe nail, a kingdom was lost, or so the saying goes. Dynamically output the full test of this proverbial rhyme.
|
|
|
3
|
+For want of a horseshoe nail, a kingdom was lost, or so the saying goes.
|
|
4
|
4
|
|
|
5
|
|
-> For want of a nail the shoe was lost.<br>
|
|
6
|
|
-> For want of a shoe the horse was lost.<br>
|
|
7
|
|
-> For want of a horse the rider was lost.<br>
|
|
8
|
|
-> For want of a rider the message was lost.<br>
|
|
9
|
|
-> For want of a message the battle was lost.<br>
|
|
10
|
|
-> For want of a battle the kingdom was lost.<br>
|
|
11
|
|
-> And all for the want of a horseshoe nail.<br>
|
|
|
5
|
+Given a list of inputs, generate the relevant proverb. For example, given the list `["nail", "shoe", "horse", "rider", "message", "battle", "kingdom"]`, you will output the full text of this proverbial rhyme:
|
|
|
6
|
+
|
|
|
7
|
+```text
|
|
|
8
|
+For want of a nail the shoe was lost.
|
|
|
9
|
+For want of a shoe the horse was lost.
|
|
|
10
|
+For want of a horse the rider was lost.
|
|
|
11
|
+For want of a rider the message was lost.
|
|
|
12
|
+For want of a message the battle was lost.
|
|
|
13
|
+For want of a battle the kingdom was lost.
|
|
|
14
|
+And all for the want of a nail.
|
|
|
15
|
+```
|
|
|
16
|
+
|
|
|
17
|
+Note that the list of inputs may vary; your solution should be able to handle lists of arbitrary length and content. No line of the output text should be a static, unchanging string; all should vary according to the input given.
|
|
12
|
18
|
|
|
13
|
19
|
# Running the tests
|
|
14
|
20
|
|
|
|
@@ -22,7 +28,7 @@ in your terminal.
|
|
22
|
28
|
|
|
23
|
29
|
## Source
|
|
24
|
30
|
|
|
25
|
|
-Wikipedia [https://en.wikipedia.org/wiki/For_Want_of_a_Nail](https://en.wikipedia.org/wiki/For_Want_of_a_Nail)
|
|
|
31
|
+Wikipedia [http://en.wikipedia.org/wiki/For_Want_of_a_Nail](http://en.wikipedia.org/wiki/For_Want_of_a_Nail)
|
|
26
|
32
|
|
|
27
|
33
|
## Submitting Incomplete Solutions
|
|
28
|
34
|
|