|
| 1 | +# House |
| 2 | + |
| 3 | +Output the nursery rhyme 'This is the House that Jack Built'. |
| 4 | + |
| 5 | +> [The] process of placing a phrase of clause within another phrase of |
| 6 | +> clause is called embedding. It is through the processes of recursion |
| 7 | +> and embedding that we are able to take a finite number of forms (words |
| 8 | +> and phrases) and construct an infinite number of expressions. |
| 9 | +> Furthermore, embedding also allows us to construct an infinitely long |
| 10 | +> structure, in theory anyway. |
| 11 | +
|
| 12 | +- [papyr.com](http://papyr.com/hypertextbooks/grammar/ph_noun.htm) |
| 13 | + |
| 14 | + |
| 15 | +The nursery rhyme reads as follows: |
| 16 | + |
| 17 | +```plain |
| 18 | +This is the house that Jack built. |
| 19 | +
|
| 20 | +This is the malt |
| 21 | +that lay in the house that Jack built. |
| 22 | +
|
| 23 | +This is the rat |
| 24 | +that ate the malt |
| 25 | +that lay in the house that Jack built. |
| 26 | +
|
| 27 | +This is the cat |
| 28 | +that killed the rat |
| 29 | +that ate the malt |
| 30 | +that lay in the house that Jack built. |
| 31 | +
|
| 32 | +This is the dog |
| 33 | +that worried the cat |
| 34 | +that killed the rat |
| 35 | +that ate the malt |
| 36 | +that lay in the house that Jack built. |
| 37 | +
|
| 38 | +This is the cow with the crumpled horn |
| 39 | +that tossed the dog |
| 40 | +that worried the cat |
| 41 | +that killed the rat |
| 42 | +that ate the malt |
| 43 | +that lay in the house that Jack built. |
| 44 | +
|
| 45 | +This is the maiden all forlorn |
| 46 | +that milked the cow with the crumpled horn |
| 47 | +that tossed the dog |
| 48 | +that worried the cat |
| 49 | +that killed the rat |
| 50 | +that ate the malt |
| 51 | +that lay in the house that Jack built. |
| 52 | +
|
| 53 | +This is the man all tattered and torn |
| 54 | +that kissed the maiden all forlorn |
| 55 | +that milked the cow with the crumpled horn |
| 56 | +that tossed the dog |
| 57 | +that worried the cat |
| 58 | +that killed the rat |
| 59 | +that ate the malt |
| 60 | +that lay in the house that Jack built. |
| 61 | +
|
| 62 | +This is the priest all shaven and shorn |
| 63 | +that married the man all tattered and torn |
| 64 | +that kissed the maiden all forlorn |
| 65 | +that milked the cow with the crumpled horn |
| 66 | +that tossed the dog |
| 67 | +that worried the cat |
| 68 | +that killed the rat |
| 69 | +that ate the malt |
| 70 | +that lay in the house that Jack built. |
| 71 | +
|
| 72 | +This is the rooster that crowed in the morn |
| 73 | +that woke the priest all shaven and shorn |
| 74 | +that married the man all tattered and torn |
| 75 | +that kissed the maiden all forlorn |
| 76 | +that milked the cow with the crumpled horn |
| 77 | +that tossed the dog |
| 78 | +that worried the cat |
| 79 | +that killed the rat |
| 80 | +that ate the malt |
| 81 | +that lay in the house that Jack built. |
| 82 | +
|
| 83 | +This is the farmer sowing his corn |
| 84 | +that kept the rooster that crowed in the morn |
| 85 | +that woke the priest all shaven and shorn |
| 86 | +that married the man all tattered and torn |
| 87 | +that kissed the maiden all forlorn |
| 88 | +that milked the cow with the crumpled horn |
| 89 | +that tossed the dog |
| 90 | +that worried the cat |
| 91 | +that killed the rat |
| 92 | +that ate the malt |
| 93 | +that lay in the house that Jack built. |
| 94 | +
|
| 95 | +This is the horse and the hound and the horn |
| 96 | +that belonged to the farmer sowing his corn |
| 97 | +that kept the rooster that crowed in the morn |
| 98 | +that woke the priest all shaven and shorn |
| 99 | +that married the man all tattered and torn |
| 100 | +that kissed the maiden all forlorn |
| 101 | +that milked the cow with the crumpled horn |
| 102 | +that tossed the dog |
| 103 | +that worried the cat |
| 104 | +that killed the rat |
| 105 | +that ate the malt |
| 106 | +that lay in the house that Jack built. |
| 107 | +``` |
| 108 | + |
| 109 | + |
| 110 | +To run the tests: |
| 111 | + |
| 112 | +```sh |
| 113 | +$ gradle test |
| 114 | +``` |
| 115 | + |
| 116 | +For more detailed info about the Java track see the [help page](http://exercism.io/languages/java). |
| 117 | + |
| 118 | + |
| 119 | +## Source |
| 120 | + |
| 121 | +British nursery rhyme [http://en.wikipedia.org/wiki/This_Is_The_House_That_Jack_Built](http://en.wikipedia.org/wiki/This_Is_The_House_That_Jack_Built) |
| 122 | + |
| 123 | +## Submitting Incomplete Solutions |
| 124 | +It's possible to submit an incomplete solution so you can see how others have completed the exercise. |
0 commit comments