forked from xxq250/Nasal-Interpreter
✨ support nasal module
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import.std.padding;
|
||||
import.std.process_bar;
|
||||
|
||||
var (leftpad, rightpad) = (padding.leftpad, padding.rightpad);
|
||||
|
||||
var char_ttf=[
|
||||
[" "," "," "," "," "," "],
|
||||
[" █████╗ ","██╔══██╗","███████║","██╔══██║","██║ ██║","╚═╝ ╚═╝"],
|
||||
|
||||
@@ -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
@@ -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
@@ -127,4 +127,4 @@ foreach(var v;training_set){
|
||||
print(v,': ',output[0].out,'\n');
|
||||
}
|
||||
|
||||
bp_example();
|
||||
mat.bp_example();
|
||||
+8
-4
@@ -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...){
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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
@@ -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"){
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import.module.libsock;
|
||||
|
||||
var socket = libsock.socket;
|
||||
|
||||
var http=func(){
|
||||
var sd=nil;
|
||||
return {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import.std.json;
|
||||
import.std.process_bar;
|
||||
|
||||
var JSON = json.JSON;
|
||||
|
||||
var ss=JSON.stringify({
|
||||
vec:[0,1,2],
|
||||
hash:{
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
+9
-7
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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,4 +1,5 @@
|
||||
import.std.sort;
|
||||
var sort = sort.sort;
|
||||
|
||||
var to_lower=func(s){
|
||||
var tmp="";
|
||||
|
||||
Reference in New Issue
Block a user