Re: [问题] 1-9位数不重复印出来(Shakespeare)

楼主: NobleDino (高贵恐龙)   2017-03-04 16:35:58
大家久等了,以下是ptt知名讨论串用Shakespeare Programming 实作。
逻辑跟我上一篇Smalltalk 实作一样,是对数字的商和余数进行判断。
https://goo.gl/RYM2bD
Shakespeare 原作者的c无法正确执行,因此我在github找到了另一个compiler
https://github.com/drsam94/Spl
可惜这个compiler说无法支援stack (实际上支援,我也不知道为什么他说不行)
为了保险起见,我并没有使用stack,是直接建立10个变量来判断。
有兴趣看详解我在贴,废话不多说了:
The following play performs on Ubuntu 14, and you shall use the compiler from
"https://github.com/drsam94/Spl" This play will determine if a number is
unique based on the absence of any repetitive digit. Some instances of
serious violation to the definition of an unique number would be: 121, 988,
677.
Romeo, the son of Montague who secretly loves and marries Juliet.
Juliet, the daughter of Capulet who secretly loves and marries Romeo.
Lady Capulet, wife of Capulet, Juliet's mother.
Montague, the patriarch of the house of Montague, Romeo's father.
Tybalt, a cousin of Juliet and rival of Romeo.
Benvolio, a cousin of Romeo and best friend.
The Ghost, who loves to insult.
King Henry, a king.
King John, a king.
King Lear, a king.
King Richard, a king.
Lady Macbeth, a lady.
Lady Macduff, a lady.
The Duke of Milan, a duke.
The Duke of Venice, a duke.
Act I: Love at the first slight.
Scene I: A lovely introduction of Romeo and Juliet.
[Enter Romeo and Juliet]
Romeo:
You pretty sweet young woman! Thou art as lovely as the difference between
the square of thyself and your smooth hair. Speak your mind.
Juliet:
Listen to your heart! You art the sum of yourself and hero.
[Exit Romeo]
Scene II: Lady Capulet charms Montague.
[Enter Montague]
Juliet:
You cursed dirty evil lying distasteful damned father! You art as
miserable as the sum of thyself and a infected smelly fat stupid animal!
[Exit Juliet]
[Enter Lady Capulet]
Lady Capulet:
Speak your mind.
Montague:
You art as foul as the sum of skilless unpracticed rural limiting
bottomless villainous mother and cow. You art as weak as the sum of tiny
normal horrid cowardly bad father and thyself. Speak your mind.
Lady Capulet:
Thou art as noble as me. You art the sum of good handsome mighty peaceful
man and thyself. You art the sum of thyself and father. Speak your mind.
Montague:
You art as good as me. You art the sum of joy and thyself. Speak your mind.
Lady Capulet:
Thou art as trustworthy as me. You art the difference between thyself and
cowardly rotten misused stinking man. You art the sum of thyself and brave
lord. Speak your mind.
Montague:
Thou art charming fair gentle warm fine lady. Speak your mind.
Lady Capulet:
Thou art as noble as a king. Open your heart!
Montague:
Speak your mind! You art as lovely as the sum of a sweet heaven and a
peaceful happy warm angel.
[Exeunt]
Act II: Capulet's support to Romeo.
Scene I: Mother always loves her beautiful daughter.
[Enter Juliet and Lady Capulet]
Lady Capulet:
You art always my girl.
[Exeunt]
Scene II: Romeo's self assert.
[Enter Lady Capulet and Romeo]
Lady Capulet:
You art the difference between yourself and the father.
Romeo:
Am I better than nothing?
Lady Capulet:
If not, we shall proceed to Let Juliet give Romeo confidence.
[Exit Romeo]
[Enter Juliet]
Lady Capulet:
You art the product of thyself and me. We shall return to Romeo's self
assert.
[Exeunt]
Scene III: Let Juliet give Romeo confidence.
[Exeunt]
[Enter Juliet and Romeo]
Romeo:
Open your heart!
Juliet:
You art the sum a brave handsome honest hero and good man. Speak your mind.
[Exeunt]
Act III: Short-tempered Cousin.
Scene I: Introduce Tybalt, Juliet's cousin.
[Enter Tybalt and Juliet]
Juliet:
You art my cousin. Open your heart.
[Exit Tybalt]
[Enter Romeo]
Juliet:
Speak your mind.
[Exit Romeo]
Scene II: Tybalt's self assert.
[Exeunt]
[Enter Juliet and Tybalt]
Juliet:
You art the sum of yourself and a cousin.
Tybalt:
Am I as miserable as you? If so, we must proceed to Act IV.
Scene III: The insults of the nobles.
[Exeunt]
[Enter The Ghost]
[Enter King Henry]
The Ghost:
You art nothing!
[Exit King Henry]
[Enter King John]
The Ghost:
You art nothing!
[Exit King John]
[Enter King Lear]
The Ghost:
You art nothing!
[Exit King Lear]
[Enter King Richard]
The Ghost:
You art nothing!
[Exit King Richard]
[Enter Lady Capulet]
The Ghost:
You art nothing!
[Exit Lady Capulet]
[Enter Lady Macbeth]
The Ghost:
You art nothing!
[Exit Lady Macbeth]
[Enter Lady Macduff]
The Ghost:
You art nothing!
[Exit Lady Macduff]
[Enter Montague]
The Ghost:
You art nothing!
[Exit Montague]
[Enter The Duke of Milan]
The Ghost:
You art nothing!
[Exit The Duke of Milan]
[Enter The Duke of Venice]
The Ghost:
You art nothing!
[Exit The Duke of Venice]
[Exit The Ghost]
Scene IV: Tybalt's assert of Benvolio.
[Enter Tybalt and Benvolio]
Tybalt:
You art as miserable as me!
Scene V: The Ghost answer of Benvolio.
[Exeunt]
[Enter The Ghost and Benvolio]
Benvolio:
Am I better than nothing?
The Ghost:
If not, let us proceed to Let Ghost talk to the rivals.
Benvolio:
You art as good as remainder of the quotient between me and the sum of an
amazing furry mighty animal and a cute chihuahua!
The Ghost:
You art the quotient between yourself and the sum of an smelly fat weak
animal and a stupid chihuahua.
The Ghost:
Am I as normal as a man? If so, we shall proceed to Scene VI. Am I as
normal as honest man? If so, we shall proceed to Scene VII. Am I as normal
as the difference between honest noble king and man? If so, we shall proceed
to Scene VIII. Am I as normal as honest noble man? If so, we shall proceed
to Scene IX. Am I as normal as sum of honest noble king and man? If so, we
shall proceed to Scene X. Am I as normal as sum of honest noble king and
stupid man? If so, we shall proceed to Scene XI. Am I as normal as
difference between honest noble peaceful king and man? If so, we shall
proceed to Scene XII. Am I as normal as honest noble peaceful king? If so,
we shall proceed to Scene XIII. Am I as normal as sum of honest noble
peaceful king and man? If so, we shall proceed to Scene XIV. Am I as normal
as sum of honest noble peaceful king and rich man? If so, we shall proceed
to Scene XV. We must proceed to The Ghost answer of Benvolio.
Scene VI: Ghost insults King Henry.
[Exeunt]
[Enter The Ghost and King Henry]
King Henry:
Am I better than nothing?
The Ghost:
You art stupid man! If so, we must return to Scene II. we must return to
The Ghost answer of Benvolio.
Scene VII: Ghost insults King John.
[Exeunt]
[Enter The Ghost and King John]
King John:
Am I better than nothing?
The Ghost:
You art stupid man! If so, we must return to Scene II. we must return to
The Ghost answer of Benvolio.
Scene VIII: Ghost insults King Lear.
[Exeunt]
[Enter The Ghost and King Lear]
King Lear:
Am I better than nothing?
The Ghost:
You art stupid man! If so, we must return to Scene II. we must return to
The Ghost answer of Benvolio.
Scene IX: Ghost insults King Richard.
[Exeunt]
[Enter The Ghost and King Richard]
King Richard:
Am I better than nothing?
The Ghost:
You art stupid man! If so, we must return to Scene II. we must return to
The Ghost answer of Benvolio.
Scene X: Ghost insults Lady Capulet.
[Exeunt]
[Enter The Ghost and Lady Capulet]
Lady Capulet:
Am I better than nothing?
The Ghost:
You art stupid man! If so, we must return to Scene II. we must return to
The Ghost answer of Benvolio.
Scene XI: Ghost insults Lady Macbeth.
[Exeunt]
[Enter The Ghost and Lady Macbeth]
Lady Macbeth:
Am I better than nothing?
The Ghost:
You art stupid woman! If so, we must return to Scene II. we must return to
The Ghost answer of Benvolio.
Scene XII: Ghost insults Lady Macduff.
[Exeunt]
[Enter The Ghost and Lady Macduff]
Lady Macduff:
Am I better than nothing?
The Ghost:
You art stupid woman! If so, we must return to Scene II. we must return to
The Ghost answer of Benvolio.
Scene XIII: Ghost insults Lady Montague.
[Exeunt]
[Enter The Ghost and Lady Montague]
Montague:
Am I better than nothing?
The Ghost:
You art stupid woman! If so, we must return to Scene II. we must return to
The Ghost answer of Benvolio.
Scene XIV: Ghost insults Duke Milan.
[Exeunt]
[Enter The Ghost and The Duke of Milan]
The Duke of Milan:
Am I better than nothing?
The Ghost:
You art stupid man! If so, we must return to Scene II. we must return to
The Ghost answer of Benvolio.
Scene XV: Ghost insults Duke Venice.
[Exeunt]
[Enter The Ghost and The Duke of Venice]
The Duke of Venice:
Am I better than nothing?
The Ghost:
You art stupid man! If so, we must return to Scene II. we must return to
The Ghost answer of Benvolio.
Scene XVI: Let Ghost talk to the rivals.
[Exeunt]
[Enter The Ghost and Tybalt]
The Ghost:
Open your heart!
[Exit Tybalt]
[Enter Romeo]
The Ghost:
Speak your mind! Let us return to Scene II.
Act IV: The Ending.
Scene I: Exit of all actors and actresses.
[Exeunt]
谢谢大家。

Links booklink

Contact Us: admin [ a t ] ucptt.com