Σπίτι

Σπίτι

Μέτριο

Οδηγίες

Απάγγειλε το παιδικό τραγουδάκι "This is the House that Jack Built".

[Η] διαδικασία να τοποθετείς μια φράση ή μια πρόταση μέσα σε μια άλλη φράση ή πρόταση ονομάζεται ενσωμάτωση. Χάρη στις διαδικασίες της αναδρομής και της ενσωμάτωσης μπορούμε να πάρουμε έναν πεπερασμένο αριθμό μορφών (λέξεων και φράσεων) και να κατασκευάσουμε άπειρες εκφράσεις. Επιπλέον, η ενσωμάτωση μάς επιτρέπει να κατασκευάσουμε μια δομή άπειρου μήκους, τουλάχιστον θεωρητικά.

Το παιδικό τραγουδάκι έχει ως εξής:

This is the house that Jack built.

This is the malt
that lay in the house that Jack built.

This is the rat
that ate the malt
that lay in the house that Jack built.

This is the cat
that killed the rat
that ate the malt
that lay in the house that Jack built.

This is the dog
that worried the cat
that killed the rat
that ate the malt
that lay in the house that Jack built.

This is the cow with the crumpled horn
that tossed the dog
that worried the cat
that killed the rat
that ate the malt
that lay in the house that Jack built.

This is the maiden all forlorn
that milked the cow with the crumpled horn
that tossed the dog
that worried the cat
that killed the rat
that ate the malt
that lay in the house that Jack built.

This is the man all tattered and torn
that kissed the maiden all forlorn
that milked the cow with the crumpled horn
that tossed the dog
that worried the cat
that killed the rat
that ate the malt
that lay in the house that Jack built.

This is the priest all shaven and shorn
that married the man all tattered and torn
that kissed the maiden all forlorn
that milked the cow with the crumpled horn
that tossed the dog
that worried the cat
that killed the rat
that ate the malt
that lay in the house that Jack built.

This is the rooster that crowed in the morn
that woke the priest all shaven and shorn
that married the man all tattered and torn
that kissed the maiden all forlorn
that milked the cow with the crumpled horn
that tossed the dog
that worried the cat
that killed the rat
that ate the malt
that lay in the house that Jack built.

This is the farmer sowing his corn
that kept the rooster that crowed in the morn
that woke the priest all shaven and shorn
that married the man all tattered and torn
that kissed the maiden all forlorn
that milked the cow with the crumpled horn
that tossed the dog
that worried the cat
that killed the rat
that ate the malt
that lay in the house that Jack built.

This is the horse and the hound and the horn
that belonged to the farmer sowing his corn
that kept the rooster that crowed in the morn
that woke the priest all shaven and shorn
that married the man all tattered and torn
that kissed the maiden all forlorn
that milked the cow with the crumpled horn
that tossed the dog
that worried the cat
that killed the rat
that ate the malt
that lay in the house that Jack built.
Επεξεργασία μέσω GitHub Ο σύνδεσμος ανοίγει σε νέο παράθυρο ή καρτέλα
Vim script Exercism

Έτοιμος να ξεκινήσεις την άσκηση Σπίτι;

Γράψου στο Exercism για να μάθεις και να κατακτήσεις Vim script με 89 ασκήσεις και πραγματική καθοδήγηση από ανθρώπους, όλα δωρεάν.