標籤:

Arnoldc詳解

Arnoldc詳解

來自專欄編程語言專欄

怎麼感覺這個語言和C++這麼像……

這個語言聽說是一部電影中主人公的話(誰這麼無聊?站出來!)

讓我們看看這個沙雕主人公想說什麼

main包

ITS SHOWTIME (你的程序) YOU HAVE BEEN TERMINATED

輸出

TALK TO THE HAND "jobbole" 輸出"jobbole" TALK TO THE HAND myvar 輸出myvar對應的值

聲明變數

HEY CHRISTMAS TREE (你的變數名,將被賦值為下面的數) YOU SET US UP (一個十六進位有字元整數) 注意:可用@I LIED 和 @NO PROBLEMO代替整數 false true

賦值

GET TO THE CHOPPER (變數名a) HERE IS MY INVITATION (變數名b或數字) (選擇性插入一大串算術) ENOUGH TALK (此時a的值將變為計算後的值)

計算

在前面的賦值上可用,opreand為操作數/變數

加法 GET UP operand 減法GET DOWN operand 乘法 YOURE FIRED operand 除法 HE HAD TO SPLIT operand 所有算術操作優先順序同一樣。

比如: a = (4 + b) * 2

GET TO THE CHOPPER a HERE IS MY INVITATION 4 GET UP b YOURE FIRED 2 ENOUGH TALK

真語句的值為 1,假語句的值為 0。

等於 YOU ARE NOT YOU YOU ARE ME operand 大於 LET OFF SOME STEAM BENNET operand 或 CONSIDER THAT A DIVORCE operand 與 KNOCK KNOCK operand

比如: a = (b + 5) > c

GET TO THE CHOPPER a HERE IS MY INVITATION b GET UP 5 LET OFF SOME STEAM BENNET c ENOUGH TALK

比如 a = (b || c) && d

GET TO THE CHOPPER a HERE IS MY INVITATION b CONSIDER THAT A DIVORCE c KNOCK KNOCK d ENOUGH TALK

if

BECAUSE IM GOING TO SAY PLEASE (變數,若非0運行) (代碼) YOU HAVE NO RESPECT FOR LOGIC

if/else

BECAUSE IM GOING TO SAY PLEASE (變數,若非0運行)(代碼) BULLSHIT //否則 (代碼) YOU HAVE NO RESPECT FOR LOGIC

while

STICK AROUND (變數,非0時運行) (代碼) CHILL //返回

比如輸出1-10

ITS SHOWTIME 開始HEY CHRISTMAS TREE isLessThan10 bool型判斷是否小於10YOU SET US UP @NO PROBLEMO yesHEY CHRISTMAS TREE n YOU SET US UP 0 0STICK AROUND isLessThan10 循環直到大於10GET TO THE CHOPPER n 改變nHERE IS MY INVITATION n 調用nGET UP 1 加上1ENOUGH TALK n=n+1TALK TO THE HAND n 輸出nGET TO THE CHOPPER isLessThan10 改變boolHERE IS MY INVITATION 10 10LET OFF SOME STEAM BENNET n 10-nENOUGH TALK 是否為10CHILL 循環截止YOU HAVE BEEN TERMINATED 結束循環

函數

定義在main包外

LISTEN TO ME VERY CAREFULLY (名字) (代碼) HASTA LA VISTA, BABY

若要加入參數,請用

I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE (參數名)GIVE THESE PEOPLE AIR //結束定義

可用

I』LL BE BACK

中途結束參數,可以返回參數

返回的參數接收

GET YOUR ASS TO MARS (變數名,對應返回值) DO IT NOW (函數名及參數)

完結撒花,°:.☆( ̄▽ ̄)/$:.° 。

為什麼這麼短

推薦閱讀:

阿里雲DTS大幅降價,即可獲得實現秒級延遲的數據傳輸服務
形似而神不似,仿生機器人如何突出重圍?
第六屆820WWEC教育者大會分論壇集錦:雙師+科技
都100%代碼覆蓋了,還會有什麼問題?

TAG:科技 |