^中文

From Esolang
Jump to navigation Jump to search

^中文 is a special language for all Chinese people!

Commands

Commands
中文 English Meaning
打印 "[文本]" Print "[text]" Prints a string of text
输出 [多变的] Output [variable] Outputs the value of a variable
输入 [多变的] Input [variable] / Enter [variable] Gives user input to a variable
如果 [变量] [条件] [值或变量] If [variable] [condition] [value or variable] If clause
别的 如果 [变量] [条件] [值或变量] Else If [variable] [condition] [value or variable] / Other If [variable] [condition] [value or variable] Else-if clause
别的 Else / Other Else clause
对于 [变量] [开始] [步骤] [结束] For [variable] [start] [step] [end] For loop
结束 对于 End For Ends for loop
标签 [文本] Label [text] Label
跳 标签 [文本] Jump Label [text] Jumps to the label specified
将 [变量] 设置为 [值] Set [variable] to [value] Sets a variable to a value
评论 [文本] Comment [text] / Comments [text] Marks a single line comment
随机整数 [开始] [结束] Random Integer [start] [end] Generates a random number between [start] and [end]
随机实数 [开始] [结束] Random Real Number [start] [end] Generates a random floating-point number between [start] and [end]
将数学 [变量] 设置为 [表达式] Set Math [variable] to [expression] Does math and stores the result in a variable
开始 评论 Start Comment Starts a multi-line comment
结束 评论 End Comment Ends a multi-line comment

Examples

Hello, world!

打印 "Hello, world!"

Or, if you want in Chinese:

打印 "你好,世界!"

Cat

输入 cat
输出 cat

Truth machine

评论 这是^中文里的真理机器!
输入 truth
如果 truth = 0
跳 标签 zero
如果 truth = 1
跳 标签 one
标签 zero
打印 0
标签 one
打印 1
跳 标签 one