世界上很好玩的6種表情符號(hào)編程語(yǔ)言
誰(shuí)能想到我們最喜歡的表情符號(hào)可以用來(lái)設(shè)計(jì)新的編程語(yǔ)言?聰明有才華的人已經(jīng)想象并開(kāi)發(fā)出了成熟的編程語(yǔ)言,我們可以用它來(lái)編寫表情符號(hào)和表情符號(hào)。
這些基于表情符號(hào)的語(yǔ)言大多是深?yuàn)W的編程語(yǔ)言( esoteric programming language),稱為esolang。然而,這些語(yǔ)言相對(duì)來(lái)說(shuō)比其他語(yǔ)言更容易理解。
esolang的定義是:
Esolang 不是為普通的軟件開(kāi)發(fā)目的而設(shè)計(jì)的。他們只是是作為一個(gè)概念的證明或者就是一個(gè)笑話。
如果你想了解世界上最難的語(yǔ)言,你可以看看我的另一篇文章。讓我們看看這五種可以使用表情符號(hào)和表情符號(hào)來(lái)編程的語(yǔ)言。
Emoji
Emoji使用一個(gè)預(yù)定義的表情符號(hào)列表來(lái)生成語(yǔ)言命令,這些表情符號(hào)可以作為標(biāo)志,Emoji是一個(gè)基于棧的語(yǔ)言。除了表情符號(hào)之外,其他所有字符都被視為字符。下面是在 Emoji 打印Hello World! 的代碼片段。
- 💬Hello, World!💬➡
輸出結(jié)果如下:
這是這個(gè)語(yǔ)言的文檔:
- 💬: Read until the next 💬 and puts that string onto the stack
- ⛽: Reads until the next 🚘 and puts that string onto the stack (can be nested, meant for storing functions)
- ➡: Prints a value from the stack
- 🚲: Puts True onto the stack
- 🚳: Puts False onto the stack
- 🚴: Inverts a boolean value from the stack
- 👫: Adds two numbers from the stack
- 👪: Multiplies two numbers from the stack
- 🌊: Subtracts two numbers from the stack
- 🍴: Divides two numbers from the stack
- 💸: Divides two numbers from the stack, returns the remainder
- 💿: Rounds a number to the nearest integer
- 📥: Rounds down a number from the stack
- 📤: Rounds up a number from the stack
- 🐂: Converts a number to a hex string
- 🔢: Converts a string to a number
- 👬: Checks if two numbers are equal
- 🐣: Checks if a number is less than another
- 🐔: Checks if a number is greater than another
- 🔚: Takes a boolean from the stack. If false, skips to the next 🐧.
- 🔙: If the last 🔚 did not skip past stuff, skip to the next 🐧.
- 🔃: Takes two strings from the stack. Runs the first, takes a boolean. If true, runs the second and repeats.
- 👥: Duplicates a stack entry
- 🔣: Converts a character to its character code
- 🔍: Converts a character code to its character
- 📲: Takes two objects, saves the first to a variable identified by the second
- 📱: Takes an object, returns the value from the variable by that name
- 📃: Returns the length of a string or array from the stack
- ✂: Takes a string and two numbers. Returns the substring from the string from the first number (inclusive) to the second number (exclusive).
- 🏃: Evaluates a string
- 📚: Creates an empty array.
- 📌: Takes an array and an object. Adds the object to the end of the array. Does not return anything, you'll want to use variables with this.
- 🔑: Takes an array or string and an index. Returns the value at that index.
- 🔀: Swaps two elements on the stack.
- 🔊: Capitalize a string.
- 🔉: Change a string to lowercase.
Emojicode
Emojicode是一種面向?qū)ο蟪绦蛟O(shè)計(jì)語(yǔ)言,我們可以用表情符號(hào)來(lái)編碼,在 Emojicode,使用表情符號(hào)讓編程變得有趣。它是一種強(qiáng)類型編程語(yǔ)言。該語(yǔ)言的作者討厭隨機(jī)空指針異常,因此,在 Emojicode,所有的實(shí)例變量都需要初始化,否則就會(huì)拋出編譯錯(cuò)誤。
下面是在 Emojicode 打印Hello World! 的代碼片段。
- 🏁 🍇
- 😀 🔤Hello, World!🔤❗️
- 🍉
輸出結(jié)果如下:
Emoji-gramming
Emoji-gramming是一個(gè)基于表情符號(hào)的深?yuàn)W的編程語(yǔ)言,這種語(yǔ)言總共有25個(gè)變量和4個(gè)命令,它們都由特定的表情符號(hào)表示。表情符號(hào)使用心型符號(hào)作為常量,例如:
- 💔 = 0
- 💜 = 1
- 💕 = 2
- 💞 = 4
- 💖 = 8
麥克風(fēng)(🎤)符號(hào)表示輸入,揚(yáng)聲器(📢)符號(hào)表示打印輸出,好像很有道理的樣子?下面是打印“ Hello,World! ”的代碼片段表情符號(hào):
- 😊🕐💖
- 😇🕐🕐
- 😊🕑🕐
- 😇🕑🕑
- 😊🕒🕑
- 😇🕒🕒
- 😊♈💖
- 😇♈🕒
- 😊📢♈
- 😊♈💜
- 😇♈💞
- 😇♈🕑
- 😇♈🕒
- 😊📢♈
- 😊♉💞
- 😇♉💖
- 😇♉🕑
- 😇♉🕒
- 😊📢♉
- 😊📢♉
- 😊♊💜
- 😇♊💕
- 😇♊💞
- 😇♊💖
- 😇♊🕑
- 😇♊🕒
- 😊📢♊
- 😊♈💞
- 😇♈💖
- 😇♈🕑
- 😊📢♈
- 😊📢🕑
- 😊♈💜
- 😇♈💕
- 😇♈💞
- 😇♈🕐
- 😇♈🕒
- 😊📢♈
- 😊📢♊
- 😊♈💕
- 😇♈🕐
- 😇♈🕑
- 😇♈🕒
- 😊📢♈
- 😊📢♉
- 😊♈💞
- 😇♈🕑
- 😇♈🕒
- 😊📢♈
- 😊♈💜
- 😇♈🕑
- 😊📢♈
- 😊♈💖
- 😇♈💕
- 😊📢♈
輸出結(jié)果如下:
Emojicoder
這是一個(gè)用特定的表情符號(hào)表示命令和參數(shù)的符號(hào)系統(tǒng),二進(jìn)制值0和1在 Emojicoder 定義了各自的表情符號(hào)。
- 🌚=0
- 🌝=1
- 🌚🌝🌚🌚🌝🌚🌚🌚 = 01001000 = H
在 Emojicoders 中有兩個(gè)修飾符如下:
- 🔡: Ascii Character 0-255
- 🔢: Integer Number 0-255
要打印參數(shù),該語(yǔ)言使用手表情符號(hào)(👋)作為輸出命令。每個(gè)命令都需要是新的一行?,F(xiàn)在,讓我們利用上述知識(shí),在 Emojicoder 打印出Hello,World! 。
- 👋🔡🌚🌝🌚🌚🌝🌚🌚🌚 //Output H
- 👋🔡🌚🌝🌝🌚🌚🌝🌚🌝 //Output e
- 👋🔡🌚🌝🌝🌚🌝🌝🌚🌚 //Output l
- 👋🔡🌚🌝🌝🌚🌝🌝🌚🌚 //Output l
- 👋🔡🌚🌝🌝🌚🌝🌝🌝🌝 //Output o
- 👋🔡🌚🌚🌝🌚🌝🌝🌚🌚 //Output ,
- 👋🔡🌚🌚🌝🌚🌚🌚🌚🌚 //Output space
- 👋🔡🌚🌝🌝🌝🌚🌝🌝🌝 //Output w
- 👋🔡🌚🌝🌝🌚🌝🌝🌝🌝 //Output o
- 👋🔡🌚🌝🌝🌝🌚🌚🌝🌚 //Output r
- 👋🔡🌚🌝🌝🌚🌝🌝🌚🌚 //Output l
- 👋🔡🌚🌝🌝🌚🌚🌝🌚🌚 //Output d
- 👋🔡🌚🌚🌝🌚🌚🌚🌚🌝 //Output !
輸出結(jié)果如下:
Emotinomicon
Emotinomicon 是由康納 · 奧布萊恩設(shè)計(jì)和創(chuàng)造的,不再使用表情符號(hào),而是使用表情字符來(lái)進(jìn)行編碼。下面是在 Emotinomicon 打印Hello,World! 的代碼片段。
- 😭!dlroW ,olleH😲⏪⏬⏩
下面是上面代碼片段的解釋,它可以幫助你嘗試執(zhí)行任何其他字符串,并獲得一些樂(lè)趣。
- 😭begin quote string
- !dlroW ,olleH
- 😲end quote string
- ⏪open loop
- ⏬pops and outputs top of stack as character
- ⏩close loop
輸出結(jié)果如下:
Emotifuck
Emotifuck使用Rust編寫,它使用八個(gè)表情符號(hào)作為命令,根據(jù)語(yǔ)言設(shè)計(jì)者的說(shuō)法,它完全是內(nèi)存安全的。
下面是命令列表和它們的等價(jià)符號(hào)。
- 🔥 - Move Right (>)
- 💯 - Move Left (<)
- 💩 - Decrement (-)[might have been better as output command ;)]
- 😂 - Increment (+)
- 💞 - Output (.)
- 🙏 - Input (,)
- 🌚 - Jump Forward ([)
- 🐸 - Jump Backward (])
Hello World! 的代碼如下。
- 😂😂😂😂😂😂😂😂🌚🔥😂😂😂😂🌚🔥😂😂🔥😂😂😂🔥😂😂😂🔥😂💯💯💯💯💩🐸🔥😂🔥😂🔥💩🔥🔥😂🌚💯🐸💯💩🐸🔥🔥💞🔥💩💩💩💞😂😂😂😂😂😂😂💞💞😂😂😂💞🔥🔥💞💯💩💞💯💞😂😂😂💞💩💩💩💩💩💩💞💩💩💩💩💩💩💩💩💞🔥🔥😂💞🔥😂😂💞
最后,祝你編程愉快,周末快樂(lè)!