หมายเหตุ: คำตอบนี้ไม่ได้หมายถึงการเป็นคู่แข่งที่ร้ายแรง
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]
ส่งออก 0 ถ้าเท็จ 1 ถ้าเป็นจริง
สิ่งนี้อาจสั้นกว่านี้ได้อย่างง่ายดาย (และหากผู้คนต้องการให้ฉันเป็นจริงความยาวของคำอาจถูกลดทอนลง) แต่หากทำเช่นนั้นจะเป็นการตบหน้าของความปรารถนาดี ฉันมักจะรู้สึกว่า Horatio เป็นฮีโร่ที่ไม่ได้รับการฝึกฝนของ Hamlet ดังนั้นฉันจึงทำให้แน่ใจว่าเขาเป็นคนเดียวที่จะส่งบทคนเดียวที่รุนแรงไปยัง Hamlet ซึ่ง Hamlet ต้องพิสูจน์ในท้ายที่สุดว่าเขาดีเท่ากับ Horatio (ซึ่งหมายถึงบรรทัดใหม่)
โค้ดนั้นเรียบง่าย ตัวละครทุกตัวจะต้องมีค่าเป็น ASCII (ตามลำดับ:) newline,space,0,2,3,B,b,E,e,O,o,T,t,V,v
จากนั้นรหัสจะเป็นกลไกแบบง่าย ๆ (โดยเฉพาะDFA ) ที่เปลี่ยนScene XI
เป็นสถานะการยอมรับและสถานะScene XII
การปฏิเสธ
.
หลังจากทำสิ่งนี้ฉันเพิ่งเสียบเข้ากับเช็คสเปียร์โดยใช้ความจริงที่ว่าฉันสามารถเลื่อนลงไปยังสถานะถัดไปเมื่อพวกเขาอยู่ติดกันเป็นตัวเลข ฉันทดสอบกับ Shakespeare เวอร์ชันที่ฉันเชื่อมโยงไว้ในชื่อเท่านั้น แต่ฉันเชื่อว่าเรากำหนดภาษาด้วยการใช้งาน iirc