Треки
/
Delphi Pascal
Delphi Pascal
/
Вправи
/
Харчовий ланцюг
Харчовий ланцюг

Харчовий ланцюг

Середня

Вказівки

Згенеруйте текст пісні «I Know an Old Lady Who Swallowed a Fly».

Хоча можна просто скопіювати текст пісні або прочитати його з файлу, ця задача набагато цікавіша, якщо підійти до неї алгоритмічно.

Це кумулятивна пісня невідомого походження.

Це один із багатьох поширених варіантів.

I know an old lady who swallowed a fly.
I don't know why she swallowed the fly. Perhaps she'll die.

I know an old lady who swallowed a spider.
It wriggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly. Perhaps she'll die.

I know an old lady who swallowed a bird.
How absurd to swallow a bird!
She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly. Perhaps she'll die.

I know an old lady who swallowed a cat.
Imagine that, to swallow a cat!
She swallowed the cat to catch the bird.
She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly. Perhaps she'll die.

I know an old lady who swallowed a dog.
What a hog, to swallow a dog!
She swallowed the dog to catch the cat.
She swallowed the cat to catch the bird.
She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly. Perhaps she'll die.

I know an old lady who swallowed a goat.
Just opened her throat and swallowed a goat!
She swallowed the goat to catch the dog.
She swallowed the dog to catch the cat.
She swallowed the cat to catch the bird.
She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly. Perhaps she'll die.

I know an old lady who swallowed a cow.
I don't know how she swallowed a cow!
She swallowed the cow to catch the goat.
She swallowed the goat to catch the dog.
She swallowed the dog to catch the cat.
She swallowed the cat to catch the bird.
She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly. Perhaps she'll die.

I know an old lady who swallowed a horse.
She's dead, of course!

Джерело

WikipediaПосилання відкривається в новому вікні або вкладці
Редагувати через GitHub Посилання відкривається в новому вікні або вкладці
Delphi Pascal Exercism

Час розпочати Харчовий ланцюг?

Зареєструйтеся на Exercism, щоб вивчати й опановувати Delphi Pascal, а також 76 вправ та справжнє наставництво від людей, і все це безкоштовно.