字
- This is still a work in progress. It may be changed in the future.
字 is an Esolang designed by PSTF. It is Chinese version of 🆒(?).
The author also inspired from 高尔夫 by islptng and Sclipting by Timwi.
You can add your command if you want. Every command that without sign is maded by PrySigneToFry.
Language Overview
Everything is like 🆒 except:
🆕(🆓) ... 🛑 -- 列 ... 止 🖇 -- 展 📎 -- 收 🔤...🔤 -- 『...』 💬 -- 言 ⌨️ -- 入 🆔 -- 设 🔢 ... 🔢 -- Removed Numbers by emoji -- 〇一二三四五六七八九 ➖ -- 负、减 🎛️ -- 聆 ➕ -- 正、加 ✖️ -- 乘 ➗ -- 除 ❓ -- 倘 ❔ -- 不 ⚖️ -- <Removed> ❗ -- 真 ❕ -- 假
New commands
Command | Meaning |
---|---|
若 ... 则 ... 否 ... 止 | An If-else statement. |
空 | No operation. |
对 ... 之 ... 作 ... 止 | A for-loop. |
若 ... 作 ... 止 | A while-loop. |
函 func_name param_list code 止 | Defines a function. |
呼 func_name param_list 止 | Calls a function. |
幂 根 对 剩 | Power, Root, Logarithm, Modulo. Note: Infix expression. |
数 浮 字 逻 表 无 乱 | Integer, float number, string, boolean, list or sequence, NULL, and Undefined behaviour. |
混 Min Max Mode 沌 | Generate a random integer between Min and Max. If mode is 1, then generate a float number. |
轮 ... 回 | Do same code forever. |
退 / 下 | Break/continue. |
且 或 俩 非 | Logical AND/OR/XOR/NOT. |
并 另 只 弗 | Bitwise AND/OR/XOR/NOT. |
翻 | Negate on integer or float number, NOT on boolean, reverse on string/sequence. |
同 异 少 多 降 溢 | Equal, not equal, less than, greater than, non-greater, non-less. |
择 a | Randomly choose an element from sequence. |
癫 a /搅...拌 | Randomly shuffle the sequence/Generate a sequence with random order with specified elements |
理 a | Sort the sequence. |
长 a | Return the length of a number or sequence. |
交 a b | Swap the value of a and b. |
密 | Generate a random string with specified length and character set of Printable characters in ASCII. |
区 a b c | Generate a sequence with the range [a, b), and with increment of c. Auto variable in the range is 迮. |
a 若 b 否 c | b?a:c in C++.
|
范 a b c | Generate a sequence with the range [a, b], and with increment of c. |
赋 a (type) (value) | Initialize "a" with specified type and value. you can omit value or type but you can't omit them all. |
置 a (type) (value) | Assign "a" with specified type and value. you can omit value or type but you can't omit them all. Note: If there is things beside 数 浮 字 逻 表 and didn't include one of them then it is treated as value. |
推 a | Push a into the stack. |
扯 a | Pull the top of stack out from the stack and store it into a. |
换 | Swap the top two stack element. |
段 start stop step | Generate a slice from a sequence or a string by specified start, end, and step. |
撅 a | Discard the variable a. |
点 | Decimal point. |
毁 灭 | Pop the stack top and discard it. 毁 pops the top, and 灭 is top two. |
写 | Output stack top as Unicode Character and discard it. |
丢 | Output stack top as integer and discard it. |
读 | Input a character and push its Unicode point into the stack. |
扔 | Input a integer and push it into the stack. |
吗 ... 止 | If stack top is not 0 then do the code between 吗 and 止. |
非 ... 止 | If stack top is 0 then do the code between 非 and 止. |
顶 | Stack top. |
俩 | Duplicates the stack top. |
换 | Swap the top two element of the stack. |
替 x a b | Replace all a's to b's in x. |
﹨ | Escaping. 断 is \n, 表 is \t, 『』 is outputting them, 符【Unicode point】 is outputting the character of this Unicode point. Also, ﹨﹨ means output ﹨. |
『『...』』 | Documental string. They didn't need to escape. |
Use ; as command seperator.
Note
Integer
Integer uses base 10 normally.
When you try to golfing, you can add 百进 to the integer to use base 100:
〇一二三四五六七八九 甲乙丙丁戊己庚辛壬癸 子丑寅卯辰巳午未申酉 戌亥零壹贰叁肆伍陆柒 捌玖乾兑离震巽坎艮坤 氢氦锂铍硼碳氮氧氟氖 钠镁铝硅磷硫氯氩钾钙 钪钛钒铬锰铁钴镍铜锌 镓锗砷硒溴氪铷锶钇锆 铌钼锝钌铑钯银镉铟锡
Type conversion
Try to divide 5(or others) by 0 will return undefined behaviour, then you can simply convert it into 99 bottles of beer, but in literally Chinese:
春日宴。 與君九十九杯酒。可以窮歡宴。綠酒一杯歌一遍。 與君九十八杯酒。可以窮歡宴。綠酒一杯歌一遍。 與君九十七杯酒。可以窮歡宴。綠酒一杯歌一遍。 …… 與君十杯酒。可以窮歡宴。綠酒一杯歌一遍。 與君九杯酒。可以窮歡宴。綠酒一杯歌一遍。 與君八杯酒。可以窮歡宴。綠酒一杯歌一遍。 與君七杯酒。可以窮歡宴。綠酒一杯歌一遍。 與君六杯酒。可以窮歡宴。綠酒一杯歌一遍。 與君五杯酒。可以窮歡宴。綠酒一杯歌一遍。 與君四杯酒。可以窮歡宴。綠酒一杯歌一遍。 與君三杯酒。可以窮歡宴。綠酒一杯歌一遍。 與君二杯酒。可以窮歡宴。綠酒一杯歌一遍。 與君一杯酒。可以窮歡宴。綠酒一杯歌一遍。 綠酒千杯腸已爛。
Outputting numbers
In Strict mode, the numbers will output as its pronounce. In Lenient mode, you can specify 乤 to 真 to output as Chinese, and to 假 for Normal Numbers.
Built-in constants
- 龤:『問天地好在。』
- 焮:與君九十九杯酒
Example
Simple Example
問天地好在。
言『問天地好在。』
Chinese equalvent because of restrict of outputting Chinese. If you use Lenient mode, then you can use this:
言『Hello, world!』
Alternated
言龤
Cat
言入
Truth Machine
扔吗若顶作言顶止止言顶
Alternated
扔吗若顶作俩写止止言顶
與君九十九杯酒
言字五除零
Alternated
言『春日宴。』赋酒数九九推酒吗言替『與君馕杯酒。可以窮歡宴。綠酒一杯歌一遍。转断』『馕』顶扯酒置酒酒减一推酒止言『綠酒千杯腸已爛。』
Alternated 2
置乤假赋酒数九九推酒吗言替『馕 bottles of beer on the wall, 馕 bottles of beer. Take ont down and pass it around, 齉 bottles of beer on the wall.』列『馕』,『齉』止列顶,顶减一止扯酒置酒酒减一推酒止言『No bottles of beer on the wall, No bottles of beer. Go to the store, buy some more, 99 bottles of beer on the wall.』
Alternated 3
言焮
Fun Video Game
赋徵〇赋蹇聆若徵同蹇作置徵徵加一置蹇聆止言『败北。转断』
Judge Even
赋馕聆赋噎替『鏖是啭数』『鏖』馕若馕模二同〇则言替噎『啭』『偶』否言替噎『啭』『奇』止
Disan count
赋馕聆赋噎『鏖是啭数转断』对范一馕一作置噎替噎『鏖』迮若迮模二同〇则言替噎『啭』『偶』否言言替噎『啭』『奇』止止