support nasal module

This commit is contained in:
ValKmjolnir
2023-07-20 00:54:57 +08:00
parent d9cf9ff49e
commit d479f13a5c
23 changed files with 282 additions and 108 deletions
+2
View File
@@ -1,6 +1,8 @@
import.std.padding;
import.std.process_bar;
var (leftpad, rightpad) = (padding.leftpad, padding.rightpad);
var char_ttf=[
[" "," "," "," "," "," "],
[" █████╗ ","██╔══██╗","███████║","██╔══██║","██║ ██║","╚═╝ ╚═╝"],
+6
View File
@@ -1,6 +1,12 @@
# Road check and auto pilot by ValKmjolnir
import.std.fg_env;
var props = fg_env.props;
var geodinfo = fg_env.geodinfo;
var maketimer = fg_env.maketimer;
var D2R = fg_env.D2R;
var simulation = fg_env.simulation;
var dt=0.01;
var intergral=0;
var derivative=0;
+1 -1
View File
@@ -24,7 +24,7 @@ var prt=func(){
var bfs=func(begin,end){
var move=[[1,0],[0,1],[-1,0],[0,-1]];
var que=queue();
var que=queue.new();
que.push(begin);
map[begin[0]][begin[1]]=2;
map[end[0]][end[1]]=0;
+1 -1
View File
@@ -127,4 +127,4 @@ foreach(var v;training_set){
print(v,': ',output[0].out,'\n');
}
bp_example();
mat.bp_example();
+8 -4
View File
@@ -2,16 +2,20 @@ import.std.padding;
import.std.file;
import.std.sort;
var source=find_all_files_with_extension("./src","cpp","h");
var sort = sort.sort;
var (leftpad, rightpad) = (padding.leftpad, padding.rightpad);
var source=file.find_all_files_with_extension("./src","cpp","h");
sort(source,func(a,b){return cmp(a,b)<0});
var lib=find_all_files_with_extension("./std","nas");
var lib=file.find_all_files_with_extension("./std","nas");
sort(lib,func(a,b){return cmp(a,b)<0});
var testfile=find_all_files_with_extension("./test","nas");
var testfile=file.find_all_files_with_extension("./test","nas");
sort(testfile,func(a,b){return cmp(a,b)<0});
var module=find_all_files_with_extension("./module","cpp","nas");
var module=file.find_all_files_with_extension("./module","cpp","nas");
sort(module,func(a,b){return cmp(a,b)<0});
var longest=func(vec...){
+2
View File
@@ -3,6 +3,8 @@
import.std.process_bar;
import.std.padding;
var (leftpad, rightpad) = (padding.leftpad, padding.rightpad);
if(os.platform()=="windows"){
system("chcp 65001");
system("color");
+3
View File
@@ -2,6 +2,9 @@ import.std.sort;
import.std.padding;
import.std.process_bar;
var sort = sort.sort;
var (leftpad, rightpad) = (padding.leftpad, padding.rightpad);
var mess=func(vec) {
srand();
var s=size(vec);
+1 -1
View File
@@ -21,7 +21,7 @@ var hex=func(){
# read file
var s=func(){
var filename = find_all_files_with_extension("./src","cpp","h");
var filename = file.find_all_files_with_extension("./src","cpp","h");
if(size(runtime.argv())!=0){
var argv=runtime.argv();
if(argv[0]=="-h" or argv[0]=="--h"){
+2
View File
@@ -1,5 +1,7 @@
import.module.libsock;
var socket = libsock.socket;
var http=func(){
var sd=nil;
return {
+2
View File
@@ -1,6 +1,8 @@
import.std.json;
import.std.process_bar;
var JSON = json.JSON;
var ss=JSON.stringify({
vec:[0,1,2],
hash:{
+3
View File
@@ -1,6 +1,9 @@
import.module.libsock;
import.std.json;
var JSON = json.JSON;
var socket = libsock.socket;
var gettime=func(){
return split(" ",os.time())[1];
}
View File
+9 -7
View File
@@ -1,8 +1,10 @@
import.test.md5;
import.test.md5_self;
import.std.process_bar;
import.std.file;
srand();
var _md5 = md5_self._md5;
var compare=func() {
var ch=[
"0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","+",
@@ -45,22 +47,22 @@ var compare=func() {
var filechecksum=func(){
var files=[];
foreach(var p;find_all_files_with_extension("./test","nas")) {
foreach(var p;file.find_all_files_with_extension("./test","nas")) {
append(files,"./test/"~p);
}
foreach(var p;find_all_files_with_extension("./std","nas")) {
foreach(var p;file.find_all_files_with_extension("./std","nas")) {
append(files,"./std/"~p);
}
foreach(var p;find_all_files_with_extension("./module","nas","cpp")) {
foreach(var p;file.find_all_files_with_extension("./module","nas","cpp")) {
append(files,"./module/"~p);
}
foreach(var p;find_all_files_with_extension(".","md")) {
foreach(var p;file.find_all_files_with_extension(".","md")) {
append(files,"./"~p);
}
foreach(var p;find_all_files_with_extension("./src","cpp","h")) {
foreach(var p;file.find_all_files_with_extension("./src","cpp","h")) {
append(files,"./src/"~p);
}
foreach(var p;find_all_files_with_extension("./doc","md")) {
foreach(var p;file.find_all_files_with_extension("./doc","md")) {
append(files,"./doc/"~p);
}
+4
View File
@@ -1,5 +1,9 @@
import.std.sort;
var var_sort = sort.var_sort;
var sort = sort.sort;
var vec=[];
setsize(vec, 1e4);
rand(time(0));
+1
View File
@@ -1,4 +1,5 @@
import.std.sort;
var sort = sort.sort;
var to_lower=func(s){
var tmp="";