標籤:

Shakespeare詳解

Shakespeare詳解

來自專欄編程語言專欄

互懟中的編程


這個語言需要超強的語文知識和代碼能力


開頭,一行文字,代表你的代碼叫什麼(似乎什麼用都沒有)


之後,演員表,只能用《羅密歐與朱麗葉》中的角色好坑啊,之後一個逗號,後面你想說什麼就說什麼。用句號結束。

就像

Romeo, a young man with a remarkable patience.


眾所周知,一場戲都是有幾幕組成,那麼用以下方法定義幕

Act I: Hamlets insults and flattery. //背景Scene I: The insulting of Romeo. //幕

你可以將每段話中的描述換掉。

當然,一個背景下必須有一個或以上幕,且用羅馬數字排序


之後就是推人了

推人用[]包著

其中有

Enter 後跟幾個人名,表示把這幾個人推上台Exit 後跟幾個人名,表示把這幾個人拉下台Exeunt 把所有人拉下台,代碼結束


接下來就是對話了

注意啦,一定是至多二人對話才有效,其他的編譯器不理

這時,比較好玩的就登場了

用貶義詞表示-1(pig),其他的表示1(tree)

在名詞前面可以加若干個形容詞,每個形容詞代表返回值乘以2

你現在可以製作2的整數次方和它的負數了。之後,用

the sum of A and B

相加,用

the difference between A and B

相減。

當然,可以用thyself(自己)或其他人名表示調用變數

之後再在這個表示一個具體數的前面寫上

You are

就能給對面的人賦值了

好變態的賦值法


Open your heart

輸出對方的目前值,用

Speak your mind

輸出對方對應的ASCII字元,用

Listen to your heart.

讀入對方的ASCII字元並存儲ASCII碼,用

Open your mind

讀入對方的數值


當然,我們要在幕之間跳來跳去,就有了

Let us return to scene IIIWe shallWe must proceed to

意思都是跳到第三幕


問題是一個必備的東西

Juliet:Am I better than you?Hamlet:If so, let us proceed to scene III.

在這裡,A問出一個問題,B可以回答If so或If not,後面一個運行語句

問題類型

用as good/bad as表相等

用better表大於

用worse表小於


你想啊,一個人難道就只能記住一個數?

Remember me

將自己的值放入對方的記憶中

Recall your imminent death

只要一個句子有Recall,就將對方記憶中彈出一個數

在這個語言中,每個人都是一個棧,每個人的值相當於棧頂數


試一下?

前方有一些非英文語言

The Infamous Hello World Program.名稱Romeo, a young man with a remarkable patience.Juliet, a likewise young woman of remarkable grace.Ophelia, a remarkable woman much in dispute with Hamlet.Hamlet, the flatterer of Andersen Insulting A/S.定義Act I: Hamlets insults and flattery.Scene I: The insulting of Romeo.[Enter Hamlet and Romeo]哈姆雷特和羅密歐的對話Hamlet:You lying stupid fatherless big smelly half-witted coward!這裡用6個詞形容coward(懦夫),表示-64You are as stupid as the difference between a handsome rich bravehero and thyself!用三個詞形容hero(英雄)表示8,之後用來和之前的-64對比,變為72Speak your mind!輸出HYou are as brave as the sum of your fat little stuffed misused dustyold rotten codpiece and a beautiful fair warm peaceful sunny summers day. -128+32=-96You are as healthy as the difference between the sum of thesweetest reddest rose and my father and yourself! (4+1)-(-96)=101Speak your mind!eYou are as cowardly as the sum of yourself and the differencebetween a big mighty proud kingdom and a horse. [101+(8-1)]=108Speak your mind.Speak your mind!"ll"[Exit Romeo]Scene II: The praising of Juliet.[Enter Juliet]Hamlet:Thou art as sweet as the sum of the sum of Romeo and his horse and his black cat! [(108+1)+2]=111Speak thy mind!o[Exit Juliet]Scene III: The praising of Ophelia.[Enter Ophelia]Hamlet:Thou art as lovely as the product of a large rural town and my amazing bottomless embroidered purse. 4*8=32Speak thy mind! Thou art as loving as the product of the bluest clearest sweetest sky and the sum of a squirrel and a white horse. 8*(1+2)=24Thou art as beautiful as the difference between Juliet and thyself. 111-24=87Speak thy mind!W[Exeunt Ophelia and Hamlet]Act II: Behind Hamlets back.Scene I: Romeo and Juliets conversation.[Enter Romeo and Juliet]Romeo:Speak your mind. oYou are as worried as the sum of yourself and the difference between my small smooth hamster and my nose. 111+(4-1)=118Speak your mind!rJuliet:Speak YOUR mind!lYou are as bad as Hamlet!0You are as small as the difference between the square of the difference between my little pony and your big hairy hound and the cube of your sorry little codpiece. [2-(-8)]^2-(-4)^3=100Speak your mind!d[Exit Romeo]Scene II: Juliet and Ophelias conversation.[Enter Ophelia]Juliet:Thou art as good as the quotient between Romeo and the sum of a small furry animal and a leech. 100/(2+1)=>33Speak your mind!!Ophelia:Thou art as disgusting as the quotient between Romeo and twice thedifference between a mistletoe and an oozing infected blister! 100/{2*[1-(-4)]}=10Speak your mind!
[Exeunt]完結撒花*,°*:.☆( ̄▽ ̄)/$:*.°* 。


實際上,這個語言就完結了

順便說一下

目前這個語言的編譯只能在轉換為C語言後才可以,如果你能將褒貶義詞什麼的都找出來寫個編譯器,你就能破吉尼斯世界記錄了。

推薦閱讀:

IM序列5:IM群聊消息如此複雜,如何保證不丟不重?
如何學習TFTP服務配置的詳細過程
一些關於國內腿足式機器人公司&研究所的信息分享
關停、變身、融合,金融科技正在改變傳統銀行業

TAG:科技 |