📝 delete system call in test files

This commit is contained in:
ValKmjolnir 2024-05-22 23:41:14 +08:00
parent f9f2cf6d47
commit b02168fc55
10 changed files with 19 additions and 29 deletions

View File

@ -38,9 +38,6 @@ std::ostream& help(std::ostream& out) {
<< " ,--#-,\n"
<< "<3 / \\____\\ <3\n"
<< " |_|__A_|\n"
#ifdef _WIN32
<< "use command <chcp 65001> to use unicode.\n"
#endif
<< "\nnasal <option>\n"
<< "option:\n"
<< " -h, --help | get help.\n"

View File

@ -1,7 +1,7 @@
use std.padding;
use std.process_bar;
use std.os;
use std.unix;
use std.runtime;
var char_ttf=[
[" "," "," "," "," "," "],
@ -196,9 +196,7 @@ var ansi_escape_sequence = func() {
}
# enable unicode
if (os.platform()=="windows") {
system("chcp 65001");
}
runtime.windows.set_utf8_output();
trans_ttf("just for test");
trans_ttf(" ValKmjolnir ");

View File

@ -4,9 +4,10 @@ use std.coroutine;
use std.process_bar;
use std.padding;
use std.os;
use std.runtime;
if (os.platform()=="windows") {
system("chcp 65001");
runtime.windows.set_utf8_output();
system("color");
}

View File

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

View File

@ -1,7 +1,7 @@
use test.md5_self;
use std.process_bar;
use std.file;
use std.os;
use std.runtime;
use std.io;
use std.math;
@ -101,8 +101,6 @@ var randomchecksum = func() {
}
}
if (os.platform()=="windows") {
system("chcp 65001");
}
runtime.windows.set_utf8_output();
filechecksum();
randomchecksum();

View File

@ -11,7 +11,7 @@ var is_windows_platform=os.platform()=="windows";
var is_macos_platform=os.platform()=="macOS";
if (is_windows_platform) {
system("chcp 65001");
runtime.windows.set_utf8_output();
}
var cpu_stat = func() {

View File

@ -1,4 +1,5 @@
use std.os;
use std.runtime;
var code=[
[1,1,1,1,1,1,1,0,1,0,0,1,1,0,1,0,1,0,1,1,0,0,1,1,1,1,1,1,1],
[1,0,0,0,0,0,1,0,0,1,1,0,0,1,0,0,0,1,1,1,1,0,1,0,0,0,0,0,1],
@ -32,8 +33,7 @@ var code=[
];
# enable unicode
if (os.platform()=="windows")
system("chcp 65001");
runtime.windows.set_utf8_output();
var texture=[" ","██"];
for(var i=0;i<size(code);i+=1) {
for(var j=0;j<size(code[i]);j+=1)

View File

@ -2,7 +2,6 @@ use module.libkey;
use std.list;
use std.runtime;
use std.coroutine;
use std.os;
use std.unix;
var game = func(x,y) {
@ -130,8 +129,7 @@ var co=coroutine.create(func() {
var main = func(argv) {
var should_skip=(size(argv)!=0 and argv[0]=="--skip");
# enable unicode
if (os.platform()=="windows")
system("chcp 65001");
runtime.windows.set_utf8_output();
print("\ec");
var g=game(15,10);

View File

@ -1,6 +1,5 @@
use module.libkey;
use std.runtime;
use std.os;
use std.unix;
var color=[
@ -277,9 +276,9 @@ var mapgen = func(mapx,mapy) {
var main = func(argv) {
var should_skip=(size(argv)!=0 and argv[0]=="--skip");
var init_counter=should_skip?5:30;
# windows use chcp 65001 to output unicode
if (os.platform()=="windows")
system("chcp 65001");
# windows use 65001 to output unicode
runtime.windows.set_utf8_output();
print(
"\ec\e[1:1H",

View File

@ -1,6 +1,6 @@
# wave collapse function 2022/4/10
# by ValKmjolnir
use std.os;
use std.runtime;
srand();
var table=[
@ -96,8 +96,7 @@ var map = func() {
}();
# enable unicode
if (os.platform()=="windows")
system("chcp 65001");
runtime.windows.set_utf8_output();
map.new(90);
for(var iter=0;iter<40;iter+=1) {