add new operand calculate const and pop

This commit is contained in:
ValKmjolnir
2023-03-10 22:27:06 +08:00
parent 8161f3c514
commit bd12fe917a
8 changed files with 151 additions and 83 deletions
+9 -4
View File
@@ -55,7 +55,7 @@ var curve1=func(line=4){
rand(100);
var s="";
for(var i=0;i<line;i+=1){
for(var j=0;j<45;j+=1)
for(var j=0;j<90;j+=1)
s~=table[int(6*rand())];
s~='\n';
}
@@ -67,7 +67,7 @@ var curve2=func(line=2){
rand(100);
var s="";
for(var i=0;i<line;i+=1){
for(var j=0;j<45;j+=1)
for(var j=0;j<90;j+=1)
s~=shadow[int(8*rand())];
s~='\n';
}
@@ -76,6 +76,11 @@ var curve2=func(line=2){
var curve3=func(line=2){
var arr=[
0,1,2,3,4,5,6,7,8,
0,1,2,3,4,5,6,7,8,
0,1,2,3,4,5,6,7,8,
0,1,2,3,4,5,6,7,8,
0,1,2,3,4,5,6,7,8,
0,1,2,3,4,5,6,7,8,
0,1,2,3,4,5,6,7,8,
0,1,2,3,4,5,6,7,8,
@@ -109,7 +114,7 @@ var curve4=func(line=4){
];
rand(time(0));
for(var i=0;i<line;i+=1){
for(var j=0;j<45;j+=1)
for(var j=0;j<90;j+=1)
print("\e["~front[16*rand()]~";"~back[16*rand()]~shadow[8*rand()]);
print('\n');
}
@@ -118,7 +123,7 @@ var curve4=func(line=4){
var curve5=func(line=4){
var vec=["▀▄─","▄▀─","▀─▄","▄─▀"];
for(var (y,p)=(0,0);y!=line;y+=1){
for(var x=0;x!=15;x+=1)
for(var x=0;x!=30;x+=1)
print(vec[p]);
print("\n");
p+=1;
+1 -1
View File
@@ -114,7 +114,7 @@ while(error>0.0005){
backward(i);
}
cnt+=1;
if(cnt>=3e5)
if(cnt>=1e4)
break;
}
if(cnt>=3e5){
+2 -2
View File
@@ -41,7 +41,7 @@ var run=func(width,height){
forindex(var j;map[i])
map[i][j]=rand()<0.45?'O':'.';
for(var r=0;r<400;r+=1){
for(var r=0;r<200;r+=1){
prt(map);
for(var i=0;i<height;i+=1)
for(var j=0;j<width;j+=1){
@@ -154,5 +154,5 @@ var ppm_gen=func(width,height){
if (size(runtime.argv()) and runtime.argv()[0]=="--generate-ppm") {
ppm_gen(1500*4,1500);
} else {
run(80,30);
run(60,25);
}
+7 -1
View File
@@ -21,8 +21,14 @@ var spliter=func(content){
for(var i=0;i<len;i+=1){
var n=content[i];
var c=chr(n);
if(('a'[0]<=n and n<='z'[0]) or ('A'[0]<=n and n<='Z'[0]) or n=='\''[0] or n=='-'[0]){
if(('a'[0]<=n and n<='z'[0]) or ('A'[0]<=n and n<='Z'[0])){
s~=c;
}elsif(c=='.' or c==',' or c=='-' or c=='\'' or c=='\"' or c=='!' or c=='?'){
if(size(s)) {
token[to_lower(s)]+=1;
}
token[c]+=1;
s="";
}elsif(size(s)){
if(s[0]!="-"[0] and s[0]!="'"[0] and s[-1]!="-"[0] and s[-1]!="'"[0])
token[to_lower(s)]+=1;