📝 add notes in test files & use system("color") to use ANSI esc seq

This commit is contained in:
ValKmjolnir 2022-09-14 23:15:36 +08:00
parent 518ce7fcb9
commit 0576459fbe
7 changed files with 10 additions and 2 deletions

View File

@ -139,6 +139,8 @@ var curve7=func(){
p=p>=4?0:p; p=p>=4?0:p;
} }
} }
# enable unicode
if(os.platform()=="windows") if(os.platform()=="windows")
system("chcp 65001"); system("chcp 65001");
trans_ttf("just for test"); trans_ttf("just for test");

View File

@ -53,7 +53,8 @@ var bfs=func(begin,end){
return; return;
} }
# enable ANSI escape sequence
if(os.platform()=="windows") if(os.platform()=="windows")
system("chcp 65001"); system("color");
print("\ec"); print("\ec");
bfs([0,0],[9,19]); bfs([0,0],[9,19]);

View File

@ -30,6 +30,7 @@ var prt=func(s,path){
} }
} }
# enable unicode
if(os.platform()=="windows") if(os.platform()=="windows")
system("chcp 65001"); system("chcp 65001");
println("\e[33m[",unix.getcwd(),"]\e[36m>\e[0m"); println("\e[33m[",unix.getcwd(),"]\e[36m>\e[0m");

View File

@ -29,8 +29,9 @@ var prt=func()
} }
func(){ func(){
# enable ANSI escape sequence
if(os.platform()=="windows") if(os.platform()=="windows")
system("chcp 65001"); system("color");
print("\ec"); print("\ec");
rand(time(0)); rand(time(0));
map=new_map(); map=new_map();

View File

@ -22,6 +22,7 @@ var code=[
[1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
]; ];
# enable unicode
if(os.platform()=="windows") if(os.platform()=="windows")
system("chcp 65001"); system("chcp 65001");
var texture=[" ","██"]; var texture=[" ","██"];

View File

@ -183,6 +183,7 @@ var co=coroutine.create(func(){
}); });
var main=func(){ var main=func(){
# enable unicode
if(os.platform()=="windows") if(os.platform()=="windows")
system("chcp 65001"); system("chcp 65001");
print("\ec"); print("\ec");

View File

@ -94,6 +94,7 @@ var map=func(){
} }
}(); }();
# enable unicode
if(os.platform()=="windows") if(os.platform()=="windows")
system("chcp 65001"); system("chcp 65001");
map.new(80); map.new(80);