注:この回答は、深刻な競合他社を意図したものではありません
To Be or Not To Be, This is the Answer.
Hamlet, the main player in our story.
Horatio, Hamlet's guide through his internal struggles.
The Ghost, a handsome honest bold fair gentle king.
Claudius, the worthless usurper of the throne.
Ophelia, who Hamlet always writes two.
Polonius, the unfortunate third man caught between Hamlet and Claudius.
Brabantio, the greater.
Banquo, the lesser.
Emilia, the greater.
Egeus, the lesser.
Othello, the greater.
Orsino, the lesser.
Tybalt, the greater.
Titania, the lesser.
Valentine, who doubled is greater.
Viola, who doubled is lesser.
Act I: A simple question in so many words.
Scene I: Hamlet passes judgment over the cast.
[Enter Hamlet and Horatio]
Hamlet:
Thou art the sum of a good healthy sunny warrior and a lovely day.
[Exit Horatio]
[Enter Claudius]
Hamlet:
Thou art the sum of The Ghost and warm cute brave trustworthy hero.
[Exit Claudius]
[Enter Ophelia]
Hamlet:
Thou art the sum of Claudius and a smooth spaceman.
[Exit Ophelia]
[Enter Polonius]
Hamlet:
Thou art the sum of Ophelia and a plum.
[Exit Polonius]
[Enter Brabantio]
Hamlet:
Thou art the sum of The Ghost and the sum of The Ghost and a rich kingdom.
[Exit Brabantio]
[Enter Banquo]
Hamlet:
Thou art the sum of Brabantio and The Ghost.
[Exit Banquo]
[Enter Emilia]
Hamlet:
Thou art the sum of Brabantio and the sum of joy and a gentle girl.
[Exit Emilia]
[Enter Egeus]
Hamlet:
Thou art the sum of Emilia and The Ghost.
[Exit Egeus]
[Enter Othello]
Hamlet:
Thou art the sum of Emilia and the sum of a cunning lover and the sweetest golden embroidered rose.
[Exit Othello]
[Enter Orsino]
Hamlet:
Thou art the sum of Othello and The Ghost.
[Exit Orsino]
[Enter Tybalt]
Hamlet:
Thou art the sum of Othello and the sum of happiness and fair fine heaven.
[Exit Tybalt]
[Enter Titania]
Hamlet:
Thou art the sum of Tybalt and The Ghost.
[Exit Titania]
[Enter Valentine]
Hamlet:
Thou art the sum of Tybalt and the sum of a happy day and a pony.
[Exit Valentine]
[Enter Viola]
Hamlet:
Thou art the sum of Valentine and The Ghost.
[Exeunt]
Scene II: The beginning of Horatio's interrogation.
[Enter Hamlet and Horatio]
Hamlet:
Horatio:
Open your mind.
Art thou as good as Tybalt? If so, let us proceed to Scene IV.
Art thou as good as Titania? If so, let us proceed to Scene IV.
Art thou as good as Ophelia? If not, let us proceed to Scene XII.
Scene III: Are we to?
Horatio:
Open your mind.
Art thou as good as The Ghost? If so, let us proceed to Scene VII.
Let us proceed to Scene XII.
Scene IV: Can we go further than t?
Horatio:
Open your mind.
Art thou as good as Claudius? If so, let us proceed to Scene III.
Art thou as good as Valentine? If so, let us proceed to Scene VI.
Art thou as good as Viola? If so, let us proceed to Scene VI.
Art thou as good as Othello? If so, let us proceed to Scene V.
Art thou as good as Orsino? If not, let us proceed to Scene XII.
Scene V: Oone oor twoo?
Horatio:
Open your mind.
Art thou as good as The Ghost? If so, let us proceed to Scene VII.
Art thou as good as Othello? If so, let us proceed to Scene III.
Art thou as good as Orsino? If so, let us proceed to Scene III.
Let us proceed to Scene XII.
Scene VI: Hamlet desperately searches for whOo?.
Horatio:
Open your mind.
Art thou as good as Othello? If so, let us proceed to Scene III.
Art thou as good as Orsino? If so, let us proceed to Scene III.
Let us proceed to Scene XII.
Scene VII: Knowing to, what to do?
Horatio:
Open your mind.
Art thou as good as Brabantio? If so, let us proceed to Scene VIII.
Art thou as good as Banquo? If not, let us proceed to Scene XII.
Scene VIII: Learning what to Bleive.
Horatio:
Open your mind.
Art thou as good as me? If so, let us proceed to Scene XI.
Art thou as good as Emilia? If so, let us proceed to Scene X.
Art thou as good as Egeus? If so, let us proceed to Scene X.
Art thou as good as Polonius? If not, let us proceed to Scene XII.
Scene IX: The Eend is nigh?
Horatio:
Open your mind.
Art thou as good as me? If so, let us proceed to Scene XI.
Let us proceed to Scene XII.
Scene X: Wee may havee succeeeedeed.
Horatio:
Open your mind.
Art thou as good as Emilia? If so, let us proceed to Scene IX.
Art thou as good as Egeus? If so, let us proceed to Scene IX.
Art thou as good as me? If not, let us proceed to Scene XII.
Scene XI: Hamlet is at peace.
Horatio:
Thou art a beacon of happiness.
Let us proceed to Scene XIII
Scene XII: The demons have won.
Horatio:
Thou art nothing.
Scene XIII: Hamlet opens up.
Horatio:
Hamlet! Open your heart.
[Exeunt]
falseの場合は0、trueの場合は1を出力します。
これは簡単に短くなる可能性があります(そして、人々が本当に私に望んでいるなら、単語の長さを短くすることができます)。私はいつもホレイショがハムレットの名のないヒーローだと感じていたので、彼がハムレットに強烈な独白を届けるものであることを確認しました。
コード自体は非常に単純です。Hamletを除くすべての文字はASCII値(順序:)でnewline,space,0,2,3,B,b,E,e,O,o,T,t,V,v
あり、コードは単純な状態マシン(具体的にはDFA)でありScene XI
、受け入れ状態およびScene XII
拒否状態として移行します。
。
これを作成した後、数値的に隣接している次の状態にドロップできるという事実を使用して、シェークスピアにプラグインしました。タイトルでリンクしたシェークスピアのバージョンでのみテストしましたが、実装iircで言語を定義すると信じています。