smilingwon20   1년 전

새 프로그래밍 언어? 인 '둣'을 개발했습니다. 작동 코드는 

byunsu_dut = {}
package_dut = []
class ko_en:
    def __init__(self, input_word):
        self.input_word = input_word
        self.dictkoendut = {"ㅂ":"q",
    "ㅈ":"w",
    "ㄷ" :"e",
    "ㄱ" : "r",
    "ㅅ" : "t",
    "ㅛ" : "y",
    "ㅕ" : "u",
    "ㅑ" : "i",
    "ㅐ" : "o",
    "ㅔ" : "p",
    "ㅁ" : "a",
    "ㄴ":"s",
    "ㅇ":"d",
    "ㄹ":"f",
    "ㅎ":"g",
    "ㅗ":"h",
    "ㅓ":"j",
    "ㅏ":"k",
    "ㅣ":"l",
    "ㅋ":"z",
    "ㅌ":"x",
    "ㅊ":"c",
    "ㅍ":"v",
    "ㅠ":"b",
    "ㅜ":"n",
    "ㅡ":"m",
    " ":" ",
    "1":"!",
    "2":"@",
    "3":"#",
    "4":"$",
    "5":"%",
    "6":"^",
    "7":"&",
    "8":"*",
    "9":"(",
    "0":")",
    ":":";",
    ";":":",
    "'":"\'",
    "\"":"'",
    ",":".",
    ".":",",
    "/":"\\",
    "\\":"/",
    "!":"1",
    "@":"2",
    "#":"3",
    "$":"4",
    "%":"5",
    "^":"6",
    "&":"7",
    "*":"8",
    "(":"9",
    ")":"0"}
    def dutkoriantoenglish(self):
        try:
            print_word = ""
            for i in self.input_word:
                if i in list(self.dictkoendut.keys()):
                    print_word += self.dictkoendut[i]
                elif i in self.dictkoendut.values():
                    for keyy, val in self.dictkoendut.items():
                        if val == i:
                            print_word += keyy
                else:
                    raise KeyError
            return print_word
        except KeyError:
            print('''엄랭의에러
{}
열쇠로금고따다들킨에러
엄랭? 실행 불가능한둣'''.format(self.input_word))
            raise TabError
    def dutkooren(self):
        global byunsu_dut
        ko = True
        en = True
        for i in self.input_word:
            if self.dictkoendut.get(i, "ad") == "ad":
                en = True
            else:
                ko = True
        if en and ko:
            return "both"
        elif en:
            return "en"
        elif ko:
            return "ko"
        else:
            return "noneofthem"
    def ipruc_koen(self):
        a = self.input_word
        if len(a) > 6 and a[:6] == "한영타자바꿈":
            lololololololololololol = ""
            lolololololololololololol = float('inf')
            for i in range(7, len(a)):
                if a[i] == " ":
                    lolololololololololololol = i + 1
                    break
                lololololololololololol += a[i]
            temp = a[lolololololololololololol:]
            n = ""
            c = False
            d = False
            e = False
            for k in range(len(temp)):
                i = temp[k]
                if not c and i != "{":
                    n += i
                elif c:
                    if i == "}":
                        c = False
                        n += str(byunsu_dut[m])
                    else:
                        m += i
                elif d:
                    n += "{"
                    d = False
                elif i == "{" and temp[k + 1] == "{":
                    d = True
                elif e:
                    n += "}"
                    e = False
                elif i == "}" and temp[k + 1] == "}":
                    d = True
                else:
                    m = ""
                    c = True
            byunsu_dut[lololololololololololol] = ko_en(n).dutkoriantoenglish()
try:
    def dutmaincode():
        a1 = str(input())
        if a1 == "둣이냐 엔트리냐":
            a1 = str(input())
            if a1 == "둣교다":
                a1 = str(input())
                if a1 == "엄랭아님...?":
                    while True:
                        a1 = str(input())
                        if a1 == "둣교믿어":
                            print("사실 둣교 사이비")
                            print('''엄랭의에러
에취에러
둣교믿어
엄랭?사실 둣교 사이비인둣.''')
                            break
                        elif "너 껌있냐?" == a1:
                            print("있다. ")
                            print('''엄랭의에러
껌십자 에러
{}
엄랭?이건니가 부탁한일이둣.'''.format(a1))
                            break
                        elif len(a1) > 5 and "패키지" == a1[:3]:
                            if a1[4:] == "한국어영어":
                                package_dut.append("ko_en")
                            elif a1[4:] == "사칙연산":
                                package_dut.append("pmmd")
                            else:
                                raise ImportError
                        elif len(a1) > 3 and a1[:3] == "선언함":
                            temp = a1[4:]
                            te1 = ""
                            te2 = ""
                            te3 = ""
                            now = 1
                            for i in temp:
                                if i == " ":
                                    now += 1
                                elif now == 1:
                                    te1 += i
                                elif now == 2:
                                    te2 += i
                                elif now == 3:
                                    te3 += i
                                else:
                                    raise BufferError
                            if te3 == "정수":
                                te2 = int(te2)
                                byunsu_dut[te1] = te2
                            elif te3 == "실수":
                                te2 = float(te2)
                                byunsu_dut[te1] = te2
                            elif te3 == "문자열":
                                byunsu_dut[te1] = te2
                            else:
                                raise BufferError
                        elif len(a1) > 3 and "출력함" == a1[:3]:
                            temp = a1[4:]
                            n = ""
                            c = False
                            d = False
                            e = False
                            for k in range(len(temp)):
                                i = temp[k]
                                if not c and i != "{":
                                    n += i
                                elif c:
                                    if i == "}":
                                        c = False
                                        n += str(byunsu_dut[m])
                                    else:
                                        m += i
                                elif d:
                                    n += "{"
                                    d = False
                                elif i == "{" and temp[k + 1] == "{":
                                    d = True
                                elif e:
                                    n += "}"
                                    e = False
                                elif i == "}" and temp[k + 1] == "}":
                                    d = True
                                else:
                                    m = ""
                                    c = True
                            print(n)
                        elif a1 == "끝":
                            break
                        elif "ko_en" in package_dut:
                            ko_en(a1).ipruc_koen()
                        else:
                            raise SyntaxError
                else:
                    print('''엄랭의에러
껌십자 에러
{}
엄랭?시작부분 안맞는둣.'''.format(a1))
            else:
                print('''엄랭의에러
껌십자 에러
{}
엄랭?시작부분 안맞는둣.'''.format(a1))
        else:
            print('''엄랭의에러
껌십자 에러
{}
엄랭?시작부분 안맞는둣.'''.format(a1))
    dutmaincode()
except KeyboardInterrupt:
    print('''엄랭의에러
보안정책에의한에러
^C
엄랭? 멈춘둣''')
except ImportError:
    print('''엄랭의에러
패키지불러오기실패에러
엄랭? 니가 말한 패키지 없는둣''')
except SyntaxError:
    print('''엄랭의에러
껌십자 에러
엄랭? 문법 오류인둣''')
except TabError:
    pass
except:
    print('''엄랭의에러
엄랭? 이유 예상 못한 에러인둣''')

입니다. 그리고 아래 코드는 둣으로 smilingwon20을 출력하는 코드입니다. 

smilingwon20   1년 전

장난이 아닌 진지한 프로그래밍 언어...? 입니다. 

preview

kjk9704   1년 전

와우ㄷㄷ

댓글을 작성하려면 로그인해야 합니다.