]]> ]]>

Числа Фибоначчи в Shakespeare

Пример для версий Lingua::Shakespeare 1.00

Используется итеративное вычисление чисел Фибоначчи. После выхода из цикла (конец второй сцены) счетчик цикла Isabella используется для вывода троеточия.

use Lingua::Shakespeare;

Fibonacci Numbers.

Isabella, the loop index.
Falstaff, a Fibonacci number.
Fortinbras, another Fibonacci number.
Sebastian, space.
Cordelia, comma.

Act I: Factorial calculations.

Scene I: Initialization.

[Enter Isabella and Sebastian]

Isabella:
  You are as fat as the product of a big black furry old cat and a white cow!

[Exit Sebastian]
[Enter Cordelia]

Isabella:
  You are as beautiful as the sum of Sebastian and the sum of a tiny yellow furry hamster and the clearest blue sky!

[Exit Cordelia]
[Enter Fortinbras]

Isabella:
  You father!

Scene II: Loop.

Isabella:
  Open your heart!
  You are as noble as the sum of yourself and Falstaff.

[Exit Fortinbras]
[Enter Falstaff]

Isabella:
  You are as brave as the difference between Fortinbras and yourself.

[Exit Falstaff]
[Enter Cordelia]

Isabella:
  Speak your mind!

[Exit Cordelia]
[Enter Sebastian]

Isabella:
  Speak your mind!

[Exit Sebastian]
[Enter Fortinbras]

Fortinbras:
  You are as good as the sum of yourself and a rose.

Isabella:
  Am I not as beautiful as your sweet charming lovely noble sister?

Fortinbras:
  If so, let us return to scene II.
  You are as good as the sum of Cordelia and a fine horse!
  Speak your mind! Speak your mind! Speak your mind!

[Exeunt]

Комментарии

]]>

blog comments powered by Disqus

]]>

Работа программистам