Монгол хэл

From Esolang
Jump to navigation Jump to search
The title of this article is not correct because of technical limitations. The correct title is actually ᠮᠣᠩᠭ᠋ᠣᠯ ᠬᠡᠯᠡ᠃.

For ease of use, I'm going to go ahead and use the wrong title.

Монгол хэл is a language based on Manchu Mongolian.

Syntax

Caption text
Монгол хэл Pseudo code
ᠳᠠᠷᠤᠮᠠᠯᠠᠬᠤ (comment)᠃ print(comment)
ᠣᠷᠣᠭᠤᠯᠬᠤ (something) [(prompt) ᠪᠡᠷ ᠰᠠᠨᠠᠭᠤᠯᠤᠮᠵᠢ ᠪᠣᠯᠭᠠᠨ᠎ᠠ]᠃ input(something, [__prompt])
ᠬᠡᠷᠪᠡ (expr)᠃ if(expr)
ᠪᠠᠰᠠ ᠪᠤᠴᠠᠭᠠᠶ᠎ᠠ ᠃ else
ᠪᠠᠰᠠ ᠪᠤᠴᠠᠭᠠᠶ᠎ᠠ ᠬᠡᠷᠪᠡ (expr)᠃ elif(expr)
ᠳᠠᠪᠬᠤᠷᠳᠠᠭᠤᠯᠤᠨ 10 ᠤᠳᠠᠭ᠎ᠠ᠃ for (i in range(10))
ᠳᠡᠭᠡᠷ᠎ᠡ ᠳᠤᠷᠠᠳᠤᠭᠰᠠᠨ ᠠᠯᠬᠤᠮ ᠳᠠᠷᠠᠭ᠎ᠠ ᠶᠢ ᠳᠠᠬᠢᠨ ᠳᠠᠪᠲᠠᠨ ᠳᠠᠪᠲᠠᠨ (expr) ᠪᠣᠯᠲᠠᠯ᠎ᠠ true ᠪᠢᠰᠢ᠃ while(expr)
(var) ᠶᠢ (type) ᠪᠠᠷ ᠲᠣᠮᠢᠶᠠᠯᠠᠨ᠎ᠠ ᠃ def var -> type
(var) ᠶᠢ (val) ᠪᠣᠯᠭᠠᠨ ᠲᠣᠬᠢᠷᠠᠭᠤᠯᠤᠨ᠎ᠠ ᠃ var=val
ᠡᠶ᠎ᠡ ᠨᠠᠶᠢᠷᠠ and
ᠡᠰᠡᠬᠦᠯ᠎ᠡ or
ᠦᠭᠡᠢ not
ᠦᠨᠡᠨ true
ᠠᠮᠠᠷᠠᠯᠲᠠ false
ᠪᠦᠬᠦ ᠲᠣᠭ᠎ᠠ ᠃ int
ᠪᠠᠭ᠎ᠠ ᠲᠣᠭᠠᠨ ᠤ ᠃ float
ᠦᠰᠦᠭ ᠦᠨ ᠲᠡᠮᠲᠡᠭ ᠃ char
ᠦᠰᠦᠭ ᠨᠢ ᠲᠡᠮᠲᠡᠭ ᠃ str
ᠪᠦᠷ ᠃ bool
ᠲᠦᠷᠦᠯ ᠦᠭᠡᠢ᠃ void

Program

Hello, world!

ᠳᠠᠷᠤᠮᠠᠯᠠᠬᠤ "Hello, world!"᠃

A+B Problem

a, b, c ᠶᠢ ᠪᠦᠬᠦ ᠲᠣᠭ᠎ᠠ ᠪᠠᠷ ᠲᠣᠮᠢᠶᠠᠯᠠᠨ᠎ᠠ ᠃
ᠣᠷᠣᠭᠤᠯᠬᠤ a
ᠣᠷᠣᠭᠤᠯᠬᠤ b
c ᠶᠢ a+b ᠪᠣᠯᠭᠠᠨ ᠲᠣᠬᠢᠷᠠᠭᠤᠯᠤᠨ᠎ᠠ ᠃
ᠳᠠᠷᠤᠮᠠᠯᠠᠬᠤ c