We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

한국어

From Esolang
Jump to navigation Jump to search
The title of this article is also called 한글.

한국어 is a language based on Hangul letters(Korean).

Syntax

Syntax
한국어 Mean
출력 (comment) $(format)$ Print comment (with format).
입력할 (something) $(format)$ Input something (with format).
면 (식) {구획} If 식 is true, do 구획.
그렇지 않으 면 (식2) {구획} If 식1 is false but 식2 is true, do 구획.
다른 {구획} If none of the above conditional expressions are true, do 구획.
10 회 반복 Repeat for 10 time.
식 이 참이 아닐 때까지 반복합니다 Repeat until 식 isn't true.
A 를 type 로 정의합니다 Define A as a type.
B 를 정의하고 10 으로 설정합니다. Define B and set it to 10.
C 를 10 으로 설정합니다. Set C to 10.
함수 정의 func Define a function and name it as func.
인수는 arg1, arg2 및 kwarg1=114514 입니다 Give function with arguments *args or **kwargs.
돌아오다 0 Return 0.
주기 (제어 변수 초기화 표현식; 조건식; 증분 표현식) for(Control variable initialization expression;Conditional expression;Incremental expressions)
Operators
한국어 Mean
Logical not.
비트 안 Bitwise not.
같음 Equality.
같지 않음 Non-equality.
보다 큼 Greater than.
미만 Less than.
보다 적지 않음 Greater or equal.
보다 크지 않음 Less or equal.
비트 고 Bitwise and.
Logical and.
이나 Logical or.
비트 이나 Bitwise or.
더할 +
-
곱하기 ×
나누기 기준 ÷
A 를 B승으로 A^B
모듈로 Modulo
치우치 증가 s++ (Even C++ scripting has been figured out, right?)
치우치 줄다 s--

and so on.

Programs

Hello, world

출력 "전 세계 여러분 안녕하세요!\n"

Kiyeok+Nieun Problem*

기연, 니은, 티케우트 를 긴 정수 로 정의합니다
입력할 기연, 니은  "%d %d"
티케우트 를 기연 더할 니은 으로 설정합니다
출력 티케우트

*Why does it is not A+B Problem? 'Cause Kiyeok in Korean is A and Nieun is B.

99 bottles of beers

주기 (색인 를 긴 정수 로 정의합니다; 색인 보다 큼 0; 색인 줄다)
{
    출력.판("벽에 걸린 맥주 %d 병,\n맥주 %d병.\n맥주 1 병을 내려 벽에, 벽에 걸린 맥주 %d 병.\n", 색인, 색인, 색인 뺄 1)
    1 초 동안 기다립니다
}
출력("벽에 걸린 맥주병은 더 이상 없고, \n더 이상 맥주 한 병이 없습니다.\n가게에 가서 좀 더 사세요, \n벽에 걸린 맥주 99병.")

or:

주기 (색인 를 긴 정수 로 정의합니다; 색인 보다 큼 0; 색인 줄다)
{
    출력.판("%d bottles of the beers on the wall, \n%d bottles of beer. \nTake 1 down, pass it around, \n%d bottles of the beers on the wall.", 색인, 색인, 색인 뺄 1)
    1 초 동안 기다립니다
}
출력("No more bottles of beer on the wall, \nno more bottles of beer. \nGo to the store and buy some more, \n99 bottles of beer on the wall.")

Cat program

문자열1 를 문자열 로 정의합니다
입력할 문자열1
출력 문자열1

Truth Machine

이응 를 불리언 로 정의합니다
입력할 이응
면 (안 이응) 
{
    출력 "영\n"
}
다른 
{
    (참) 이 참이 아닐 때까지 반복합니다
    {
        출력 "한\n"
    }
}

Categories