dongbei

From Esolang
Jump to navigation Jump to search

dongbei is a language created by Zhanyong Wan following wenyan. Its source code reflects the characteristics of Northeastern Mandarin, a branch of Mandarin Chinese native to some 120 million people. It is implemented in, and mutual operatable with, Python.

Code samples

Hello World:

嘀咕:“Hello World”。         # literally: whisper "Hello World".

Running any Python code:

整eval(“# Python code”)。    # lit. gotta eval ("# Python code").

99 bottles of beer:

酒数从99到1一步-1蹿磨叽:        # lit. #wine roams -1 steps a stride from 99 to 1
  嘀咕:酒数、“ bottles of beer on the wall, ”、酒数、“ bottles of beer.”。
  嘀咕:“Take one down, pass it around, ”、酒数减一、“ bottles of beer on the wall.\n”。
磨叽完了。
嘀咕:“2 bottles of beer on the wall, 2 bottles of beer.\nTake one down and pass it around, 1 bottle of beer on the wall.\n\n1 bottle of beer on the wall, 1 bottle of beer.\nTake one down and pass it around, no more bottles of beer on the wall.\n\nNo more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.”。

A more complex example:

无产阶级的接班银图形阶级咋整:	# lit. The class Figure, succession of Proletariat
# in dongbei, Proletariat is logically the common ancestor class
  面积咋整:			# lit. area gotta be
    整叉劈了:NotImplemented。
  整完了。
整完了。

图形阶级的接班银圆阶级咋整:    # lit. The class Circle, succession of Figure
  新对象(半径)咋整:          # lit. new object (radius) gotta be
    俺的半径装半径。            # lit. my radius = radius
  整完了。
  面积咋整:
    翠花,上math。		# import math, lit. Cuixua, math please!
    滚犊子吧math.pi乘俺的半径乘俺的半径!
  整完了。
整完了。

图形阶级的接班银矩形阶级咋整:		# class Rectangle
  新对象(长,宽)咋整:
    俺的长跟俺的宽抱团装长跟宽抱团。	# tuple assignment
  整完了。
  面积咋整:
    滚犊子吧俺的长乘俺的宽。
  整完了。
整完了。

那啥都是活雷锋。		# lit. all of That is living Lei Feng!
那啥来了个圆的新对象(3)。	# lit. in That came a new object of Circle (3)
那啥来了个矩形的新对象(3,5)。
老张在那啥磨叽:		# lit. Lao Zhang roams in That
  嘀咕:老张整面积。		# lit. whisper Lao Zhang gotta area
磨叽完了。

# Output:
# 28.274333882308138
# 15

Computational class

Turing complete, because it can invoke any Python code.

See also