ESOlang
Hello guys :)
I saw ESOlang (Which is code that hard to read) and i want to make them. So i made ESOlangkit.
Supplies
ESOlangkit(free to use!) Download: https://github.com/jeongseoanjeong/ESOlangkit
Fix/customize the Code!
This python3 code interprets the code you made.
please readme.md and fix downloaded code!
like this:
(I recommend to fix and customize only values of operators and error!)
fileext=“.apple”
Test Your Code!
if you finished customizing code, then you can test.
case of me, i made this.
###########
#난해한 언어 키트
#이 키트는 퍼블릭 도메인에 의해 배포됩니다.
#수정하실 분은 수정하시고, 언제든 다른 언어로 번역하실 자원봉사자분들도 환영합니다!
#이 구문은 파이썬3으로 열어야 합니다.(파이썬2 이용시, input()->raw_input())
import sys
#줄 번호를 나타내는 변수
li=0
#파일 확장자 지정
fileext=".jslang"
#파일 확장자 에러 시 지정문구
fileexterror="파일불안"
#파일 맞는지 여부
file_correct=False
#파일 이름
filename=""
#필수 문구가 맞지 않으면 나타나는 에러
SEerror="걍 정서불안"
#코드 리스트
command_list=[]
#처음/끝 필수 문구 지정
start="#정서안정"
end="#정서불안"
#변수 선언 구문 지정(ex. "정"으로 지정하면 "정"이 있어야만 변수로 읽힘)
v1="정"
#포인팅 변수 지정(ex. "안"으로 지정하면 "안"이 몇개인지를 세어 ("안"의개수)번째 변수를 조작.리스트로 하는것을 추천.
v2=["아","안"]
#변수 리스트
var_list=[0]
#증가 연산자
add="<"
#감소 연산자
sub=">"
#곱하기 연산자
mul="ㅋ"
#print문
printvar="트롤"
#곱하기 연산자 지정
##################
#if문 정의 구문 사용법
#(변수1)(if문 정의 구문)(변수2)(같다면/아니라면 구문)(실행문)
#변수는 변수 선언과 포인팅 변수 지정구문에 따름.
#if문 정의 구문 지정
ifvar="가천"
#같다면 구문(if문 정의 구문 필수)
eqvar="?"
#아니라면 구문(if문 정의 구문 필수)
notvar="!"
#if문 오류시 메시지
iferror="복정 잡대"
#jump문 구문
jmp="연세"
#return(exit) 구문
ret="귀찮다"
#exit 메시지
exitmsg=["다 귀찮음[","]"]
#input 구문
inputvar="입"
#문자열오류(문자는 표현 가능하지만, 문자열은 표현 불가능)
strerror="너무 길어 정서불안"
#형변환구문
casting="불"
#시스템 인수 읽기
for j in range(len(sys.argv)):
if fileext in sys.argv[j]:
file_correct=True
filename=sys.argv[j].split("\n")[0]
break
#확장자 검사 구문
if not file_correct:
print(fileexterror)
sys.exit(1)
#메인구문
with open(filename,"r") as f:
command_list=f.readlines()
for c in range(len(command_list)):
command_list[c]=command_list[c].split("\n")[0]
if command_list[0]!=start or command_list[-1]!=end:
print(SEerror)
sys.exit(-1)
while li<len(command_list):
cnt=0
result=False
code=command_list[li]
for i in v2:
cnt+=code.count(i)
if v1 in code:
while True:
if len(var_list)>cnt:
break
else:
var_list.append(0)
if str(var_list[cnt]).isdigit():
if not mul in code:
var_list[cnt]+=code.count(add)-code.count(sub)
else:
l,r=code.split(mul)
var_list[cnt]+=(l.count(add)-l.count(sub))*(code.count(add)-code.count(sub))
else:
var_list[cnt]=chr(ord(var_list[cnt])+code.count(add)-code.count(sub))
if ifvar in code:
l_,r_=code.split(ifvar)
c_l=0
c_r=0
for i in v2:
c_l+=l.count(i)
c_r+=l.count(i)
l=var_list[c_l]
r=var_list[c_r]
if l==r and eqvar in code:
result=True
elif l!=r and notvar in code:
result=True
elif not (notvar in code or eqvar in code ):
print(iferror)
sys.exit(2)
if printvar in code:
for i in v2:
cnt+=code.count(i)
print(var_list[cnt])
if casting in code:
if str(var_list[cnt]).isdigit():
var_list[cnt]=chr(var_list[cnt])
else:
var_list[cnt]=ord(var_list[cnt])
if inputvar in code:
a=input()
b=0
for i in v2:
cnt+=code.count(i)
if a.isdigit():
b=int(a)
elif len(a)==1:
b=a
else:
print(strerror)
sys.exit(3)
var_list[cnt]=b
if result:
if jmp in code:
cnt=code.count(add)-code.count(sub)
if cnt==0:
for i in v2:
cnt+=code.count(i)
cnt=var_list[cnt]
else:
i=cnt
if ret in code:
cnt=code.count(add)-code.count(sub)
if cnt==0:
for i in v2:
cnt+=code.count(i)
cnt=var_list[cnt]
else:
i=cnt
print(exitmsg[0]+str(cnt)+exitmsg[1])
sys.exit(0)
li+=1
then i made file like
%%file test.jslang #정서안정 입정 트롤정 불정 트롤정 #정서불안
and execute:(kit.py ,test.jslang -> change the name to yours :) ex: runtime.py )
python3 kit.py test.jslang
in this code, if i insert a char ‘t’:
t t 116
is printed.(first line:input())