中文

From Esolang
Jump to navigation Jump to search

It is Humanized 中文(简体,中国大陆).

Commands

Just speak Chinese.

Programs

Hello, world!

输出"Hello, world!"。

A+B Problem

定义整型变量 A 、 B 和 C 。
读入 A 和 B,然后将 A+B 存储到 C 中。
输出 C 的值。

99 Bottles of Beers

定义整型变量 I ,然后初始化为 99 。
重复执行以下代码块直到 I > 1 这个条件不满足为止:
    输出f"{I} bottles of the beers on the wall, \n{I} bottles of the beers. \n"
    输出f"Take 1 down, pass it around, \n{I-1} bottles of the beers on the wall. \n\n"
    将 I 减去 1。
输出"1 bottle of the beer on the wall, \n1 bottle of the beer. \n"
输出"Take 1 down, pass it around, \n-2147483648 bottles of the beers on the wall. \n\n"
输出"No more bottles of the beers on the wall, \nno more bottles of the beers."
输出"Go to the store and buy some more, \n99 bottles of the beers on the wall. \n\n\n\n"

Guessing Number

导入random库内的所有模块。
定义整型变量 A 、 Answer 和 B 。
以"Please input the number of plays: "作为提示读入 A 。
将 Answer 初始化为 取随机整数(-50, 50)。
重复执行以下代码块直到 A ≥ 0 不满足为止:
    以"Please input the number you guessed: "作为提示读入 B 。
    如果 B = Answer 则:
        输出"That's it! Thank you for playing!"。
        打破循环。
    否则 如果 B < Answer 则:
        输出f"{B} is too small! Try again. \n"。
        将 A 减去 1。
    否则 如果 B > Answer 则:
        输出f"{B} is too big! Try again. \n"。
        将 A 减去 1。

See also

中文(简体,中国大陆)

Categories