Misc Testing 1
Jump to navigation
Jump to search
Combinators Commands
a1=LAMBDACALCULUS(
function lc(){
return(B(COS,SIN))
}
);
a1(34)
a1=LAMBDACALCULUS(
()=>B(SIN,COS)
)
a1(23)
b(sin)(cos) etc?
// this works
a1=LAMBDACALCULUS(
function ()
{
return(B(SIN)(COS))
}
);
a1(45)
a1=LAMBDACALCULUS(
()=>B(SIN)(COS)
);
a1(45)
// easier notations
λ=LAMBDACALCULUS;
a1=λ(()=>B(SIN)(COS))
a1(45)
// easier notations
λ=LAMBDACALCULUS;
a1=λ(()=>BLUEBIRD(SIN)(COS))
a1(45)
// easier notations
λ=LAMBDACALCULUS;
a1=λ(function(){return(BLUEBIRD(SIN)(COS))})
a1(45)
// easier notations
λC=LAMBDACALCULUS;
a1=λC(()=>BLUEBIRD(SIN)(COS));
a1(45)
a1=
λC(
function ()
{
//BLUEBIRD(SIN)(COS));
return(B(Parts)(Length))
}
)
a1(1..100);
// something along these lines.
a1=
λC(
function ()
{
//BLUEBIRD(SIN)(COS));
return(B(Parts)(Length))
}
)
a1(1..100);
Array Member Functions and Globalized Equivalent
// actual
SIN(COS(45))
SIN(COS(45deg))
Parts(1..100,20)
[1..10].zip([11..20]) // .zip member function
Zip([1..10],[11..20]) // globalized .zip member function
Shuffle(1..10)
Size(1..10)
Size([1..10])
Tail([1,2,3,4,4,5,5,5])
Equal(1..10,1..10)
Parts(1..10,5)
Pieces("test test etest seret es ",4)
// strings are split and treated as arrays.
Length(1..10)
a=1..100;
Length(a)
a=[1..100];
Size(a)
// did not work
Explode([1,2,3,])
1..10.parts(2..5)
|3,4,5,1..10|.parts(2..5)
SIN((1..120)<>deg)
String Functions Testing
Length("t4s"#)
"This is a test of the EMS"#["s"] // split with s
a1="This is a test of the EMS"#[3]
a1="This is a test of the EMS"#[3,2] // split into pieces of 3 and 2
a1="This is a test of the EMS"#[3,"s"]
a1="This is a test of the EMS"#[3,/\s/] // split into pieces of 3 and then split by spaces \s
a1="This is a test of the EMS"#[3,Length]
a1="This is a test of the EMS"#[3,Length@SIN] // split into pieces of 3 and then get their SIN Of their length
a1="This is a test of the EMS"# // split string into array
B=A=1..10;
B|==|A
B=A=1..10;
B|x==y|A
MOPWITHEQ(1..10,1..10); // issues as fn returns.
why the following gives true?
ISLAMBDAEQUATION("LT")
MOPWITHEQ(1..10,1..10);
MOPWITHEQ(1..10,1..10);
eq=MOPWITHEQ
𐎲 = MOPWITHEQ;
𐎲(1..10,1..10);
𓈃 = MOPWITHEQ;
Σ(𓈃("RRGW"#,"RGGW"#))
𓃌
𓃊
𓃍
𓎎
// Pointfree APL Code.
𓈃 = MOPWITHEQ;
(𓈃@Σ)("RRGWRR"#,"RBBWWW"#)
Length("testings fasdf asdf asd sdf")
("testings fasdf asdf asd sdf"#["s"]) ~
"testings fasdf asdf asd sdf"#[/[a-g]/]
𓈰=|3,4,[4]|;
𓈰|*|3443
λC(
()=>
{
// Lambda Code Here
}
)
a1=λC(
()=>
{
return(B(SIN)(COS))
}
);
a1(45deg)
Chunks(1..100,4)|/|45
1..100.pieces(2..3)
1..100.pieces(2..3,SUM)
1..100.pieces(2..3,[SUM,AVG])
1..100.pieces(2..3,[SUM,AVG],0..1)
1..100.fullpieces(2..3)
(Zip@(Parts.curry(2)))(1..100) // does it work?
1..100|x^2|
//https://www.youtube.com/watch?v=59vAjBS3yZM&t=113
('ssf454562631426'#).buckets()
https://www.youtube.com/watch?v=JELcdZLre3s
// Composition Intuition
(1..100)|+|;
(1..100)|+|;
SUM(1..100)
1..10|..|1..10
1..10|.|1..10
(1..100)|↧|
(1..100)|↥|
(1..100)|↧|;
(1..100)|↥|;
(1..100)|↥|50;
(1..100)|<|50
(1..100)|.+|;
1..100n)|.*|;
(1..100)|./|;
(1..100)|.^|2;
(1..100)|.==|;
(1..100)|.==|(1..100);
(1..100)|.==|
(1..10)|.%|
(1..10)|.^|null
(1..10)|.^| // will use 2 so as not to break old code.
(MS(9)#)|*|
(1..10)#1 breaks right has to be an array or fromtoadv breaks on parsing
(1..10)±
a=-5..10;
∑±a;
∑±a;
// https://www.youtube.com/watch?v=a7CSK7HNEWQ
a=[-2,-3,4,5,-3,4];
∏±a;
a=[-2,3,4,5,-3,4];
∏±a;
function DisplayDataHint(anyhint,SomeStayOn, KeepCaseSensitive)
SomeStayOn // gives dark css for tooltip
(1..10)#/3/
(1..10)#3
(1..10)#
(1..10)#[3]
(1..10)#[0]
(1..10)#0..5
(1..10)#3..5
// now gives dates
((1..10)#"shuffle")()
// should this work?
(1..10)#[3,[0,1]]
(1..10)#[3,[SIN,COS]]
(1..10)#[SIN,COS]
// important distinction.
(1..10)#[SIN,COS]
// calling function at first level is for *filtering* like ISNUM etc predicate function.
(1..10)#[3,[SIN]]
// calling function at first level is for computing.
(1..10)#[3,[x=>x>4]]
(1..10)#(x=>x>4)
(1..10)#[3,[x=>x>4]] // here predicate function will use entire left array.
(1..10)#[x=>x>4] // this is predicate application
(1..10)#(x=>x>4) // straight evaluation of function. In this case will give false true masks.
(1..10)#(SIN) // straight evaluation of function.
(1..10)#(x=>x>4) // true false mask flags
(1..10)#[x=>x>4] // filters by function as predicate
(1..10)#[[x=>x>4]] // applied to entire left array.
(1..10)#[[x=>x^3]]
(1..10)#(x=>x^3)
// note the way predicates and functions are applied intelligently based on how the arrays are loaded to do the application
(1..10)#[/[3,4]/]
(1..10)#[/[3,4]/]
(1..10)#[/\d/]
(1..10)#[/^\d$/]
(1..100)#[/^\d\d$/]
(1..100)#(fn:=x>34)
(1..100)#([fn:=x>34])
(1..100)#(fn:=x>34)
(1..100)#[[fn:=x>34]]
(1..100)#/^\d\d$/ // flags of predicate or fn application on left. on each element.
fn:=x+45;
fn(34)
#a-z stopped working.
(#a-z)#/a/
(#a-z)
(#a-z)#0
(#a-z)#[0,6]
"abcd"#
"abcd"#/c/
//split with c
"abcd"#'d'
"abcd"#[1,2]
"abcd"#[2]
"abcd"#[2,1]
"abcdefghijklmnop"#[5,1]
"abcdefghijklmnop"#[5,2]
"abcdefghijklmnop"#[6,2]
cars=
{
name:"lyla",
age:25
};
cars#"name";
cars#["name","age"];
cars#;
cars#/nam/
cars#((x,i)=>25==x)
cars#((x,i)=>"lyla"==x)
cars=
{
name:"lyla",
age:25,
namaste:true
};
cars#((x,i)=>/nam/)
// why?
// reciprocal
1..100|1/x|
∏|4|#
∏|4,2,3,5,1..10|#
∏|4,2,3,5,1..10|#1
// (EQ@Σ)("RRGWRR"#,"RBBWWW"#)
[1,2,3]|*|[[2],[3],[4]]
1..10@[SIN,COS,"x^2"];
03/01/2024
// did not parse
("RRGWRR"#)|x==y|("RBBWWW"#)
("RRGWRR"#)|.==|("RBBWWW"#)
// works
("RRGWRR"#)|MATRIXEQUAL|("RBBWWW"#)
//new adds
MS(3)|++|MS(3)
(1..10)#[0]
(1..10)#[1,2]
(1..10)#[[1,2]]
// https://thecodest.co/blog/power-of-functional-programming-in-javascript-part-2-combinators/
// combinators
// function trains
//eval([COS,SIN,TAN,SUM].$fnx())(45)
[COS,SIN,TAN,SUM].$fnx()
[COS,SIN,TAN,SUM].$fnx()(45)
[COS,SIN,TAN,SUM].$atop()(45)
[COS,SIN].$atop()
[COS,SIN,TAN,SUM].$atop()(45)
[COS,SIN,TAN,SUM].$atop()(22..45)
[COS,SIN,TAN].$atop()(22..45)
[SUM,[SIN,TAN]].$atop()(22..45)
[[SIN,TAN],SUM].$atop()(22..45) // more like the way to operate
[[SIN,TAN],SUM].$fnx()(22..45)
([[SIN,TAN],SUM].$fnx())+""
([[SIN,TAN],SUM].$fnx())(45..90)
([[[SIN],[TAN]],SUM].$fnx())(45..90)
([[[SIN],[TAN]],SUM].$fnx())(49,39)
([[[SIN],[TAN]],SUM].$fnx())(49,34)
([[[SIN],TAN],SUM].$fnx())(49,34)
([[[SIN],TAN],SUM].$fnx())+""
([[[SIN],TAN,[COS]],SUM].$fnx())+""
([[[SIN],[TAN],[COS]],SUM].$fnx())+""
([[SIN,TAN,[COS]],SUM].$fnx())+""
[DIVIDE,SUM,Length].$fork()
[DIVIDE,SUM,Length].$fork()(1..100)
[DIVIDE,SUM,Length].$fork()([5, 3, 2, 8, 4, 2])
$Fork([DIVIDE,Length,SUM])([2,3,4,5])
[DIVIDE,SUM,Length].$fork()([5, 3, 2, 8, 4, 2])
[SIN,COS,TAN].$sequence()(1..10)
// does not have to return values. just need to run them in sequence, no array result expected.
// if needed, could have a wrap functionality to fnx with an array member doing that.
[SIN,COS,TAN].$pipe()(1..10)
[SIN,COS,TAN].$compose()(1..10)
[SIN,COS,TAN].$tap()(1..10)
// done: with itself call in parallel.
// (function(a){return(ITSELF(TAN(COS(SIN(a)))))})
// how to reflect ITSELF a in this. Maybe another indicator to capture and reflect?
// and how do we wrap a set into an array?
[SIN,COS,TAN].$tap()(10)
[x=>x>4?1,x=>x>8?2,x=>x>14?3].$alternation()(10)
[x=>x>4?1,x=>x>8?2,x=>x>14?3].$alternation()(10)
[x=>x>4?1,x=>x>8?2,x=>x>14?3].$alternation()+""
[x=>x<4?1,x=>x<8?2,x=>x<14?3].$alternation()(10)
[].$combinators()
[SIN,COS].$combinators("B")(3)
[SIN,COS].$fnx("B")(3)
// display message was on editor.on handler.
[SIN,COS].$combinators("B")(3)
[].$combinators("I")(3)
[SIN,COS].$combinators("K")(3) // gives SIN as it ignore COS etc. constant
[3,43].$combinators("K")
[DIVIDE,SUM,Length].$combinators("Φ")(1..10)
// errors on this one.
[DIVIDE,SUM].$combinators("Σ")(1..10)
// not working. as a is not generating a function.
[SIN,COS].$combinators("Σ")(1..10)
[SIN,COS].$fnx("⊣⊢")(1..10)
[].$combinators()
//add by default
window['λ⊣⊢']
//can still work
$combinators([SIN,COS],"B")(1..20)
[DIVIDE,SUM,Length].$combinators("B")(1..10) // gives error
// get it cleared between $combinators and $fns for a combinator indicator
$alternation([SIN,COS])(1)
// combinators
" const B = a => b => c => a(b(c)) ;"+
" const B1 = a => b => c => d => a(b(c)(d)) ;"+
" const B2 = a => b => c => d => e => a(b(c)(d)(e)) ;"+
" const B3 = a => b => c => d => a(b(c(d))) ;"+
" const C = a => b => c => a(c)(b) ;"+
" const C_ = a => b => c => d => a(b)(d)(c) ;"+
" const C__ = a => b => c => d => e => a(b)(c)(e)(d) ;"+
" const D = a => b => c => d => a(b)(c(d)) ;"+
" const D1 = a => b => c => d => e => a(b)(c)(d(e)) ;"+
" const D2 = a => b => c => d => e => a(b(c))(d(e)) ;"+
" const E = a => b => c => d => e => a(b)(c(d)(e)) ;"+
" const F = a => b => c => c(b)(a) ;"+
" const F_ = a => b => c => d => a(d)(c)(b) ;"+
" const F__ = a => b => c => d => e => a(b)(e)(d)(c) ;"+
" const G = a => b => c => d => a(d)(b(c)) ;"+
" const H = a => b => c => a(b)(c)(b) ;"+
" const I = a => a ;"+
" const I_ = a => b => a(b) ;"+
" const I__ = a => b => c => a(b)(c) ;"+
" const J = a => b => c => d => a(b)(a(d)(c)) ;"+
" const K = a => b => a ;"+
" const L = a => b => a(b(b)) ;"+
" const M = a => a(a) ;"+
" const M2 = a => b => a(b)(a(b)) ;"+
" const O = a => b => b(a(b)) ;"+
" const Q = a => b => c => b(a(c)) ;"+
" const Q1 = a => b => c => a(c(b)) ;"+
" const Q2 = a => b => c => b(c(a)) ;"+
" const Q3 = a => b => c => c(a(b)) ;"+
" const Q4 = a => b => c => c(b(a)) ;"+
" const R = a => b => c => b(c)(a) ;"+
" const R_ = a => b => c => d => a(c)(d)(b) ;"+
" const R__ = a => b => c => d => e => a(b)(d)(e)(c) ;"+
" const S = a => b => c => a(c)(b(c)) ;"+
" const T = a => b => b(a) ;"+
" const U = a => b => b(a(a)(b)) ;"+
" const V = a => b => c => c(a)(b) ;"+
" const V_ = a => b => c => d => a(c)(b)(d) ;"+
" const V__ = a => b => c => d => e => a(b)(e)(c)(d) ;"+
" const W = a => b => a(b)(b) ;"+
" const W_ = a => b => c => a(b)(c)(c) ;"+
" const W__ = a => b => c => d => a(b)(c)(d)(d) ;"+
" const W1 = a => b => b(a)(a) ;"+
" const Y = a => (b => b(b))(b => a(c => b(b)(c))) ;"+
Length("this is a test"#)
also borders of matrices in display
cars=
{
name:"lyla",
age:25,
namaste:true
};
cars#/nam/;
Object.keys(window)
.filter(
function(k)
{
//console.log("k is ",k);
if(k.match(/\$/))
{
console.log(k)
}
}
)
[SIN,COS,TAN].$fnx('GOLDFINCH')(1..3)
[SIN,COS,TAN].$fnx('HUMMINGBIRD')(1..4)
[SIN,COS,TAN].$fnx('HUMMINGBIRD')+""
// is that correct?
// other commands
DAY(#03/05/2024-03/15/2024)
Chunks(Flatten(MS(15)),10)
Σ(1..100|./|3)
(1..100|.^|(1..3))
// $combinators should be used for all lambda fns.
// fns is to construct a program out of array. Does not understand the combinator indicator from the parameter.
// should we make it understand?
[SIN,COS].$combinators("B")(3)
[SIN].$combinators("⊣⊢")(34)
[SUM,NTHROOT.curry(2)].$combinators("B")(1..10)
SUM(NTHROOT.curry(2)(1..10)) // check for above
[DIVIDE,SUM,Length].$combinators("Φ")(1..10)
[DIVIDE,SUM,Length].$combinators("Φ")(1..10)
(λΦ([DIVIDE,SUM,Length]))(1..10)
λΦ([DIVIDE,SUM,Length])(1..10)
λB([SIN,COS])(1..10)
λB([POWER.curry(3),SUM])(1..10)
λB([POWER.curry(1..5),SUM])(1..10)
// new set 03062026
//-----------------------
1..10|.#|1..10 // CONCAT each.
// try https://www.youtube.com/watch?v=8ynsN4nJxzU
-- issues jp 03202024
a=1..10;
a.reduce(
function(x,y){return([MAX(x,x+y)])},
[0,0]
)
gives date result why?
[0,0]+0 becomes date i think. some issue to research i think.
a=1..10;
a=[-2, 1, -3, 4, -1, 2, 1, -5, 4];
_x=0;
_y=0;
a|[MAX(x,_x),MAX(x,_x)<0?_y:_y++]|0
// kind of unfinished.
a=1..10;
a=[-2, 1, -3, 4, -1, 2, 1, -5, 4];
_x=0;_y=0;
a.accumulatewith(
(x,y)=>_x+x>_x?[_x=MAX(_x+x,_x),_y++
)
nums = [1,1,0,1,1,1];
nums.$("x==1?1:','")
nums#/1/
nums = [1,1,0,0,1,1,1];
nums.slices(0,false,true).print()
//https://leetcode.com/problems/three-consecutive-odds/description/
arr = [2,6,4,1,4,5,6,3,4,5,5,5,5];
arr.slices(ISODD)
arr.slices(ISEVEN)
// https://leetcode.com/problems/maximum-gap/description/
nums = [3,6,9,1];
MAX(nums.pieces(2,MINUS@ABS))
nums = [3,6,9,1];
nums.sort().pieces(2,MINUS)
MAX(nums.sort().pieces(2,MINUS@ABS))
// something not adding up to comment on https://leetcode.com/problems/maximum-gap/description/ about that it is 3, because
nums = [3,6,9,1];
nums.sort().pieces(2,MINUS,true)
MAX(nums.sort().pieces(2,MINUS@ABS,true))
Array.prototype.chunks could have fn like Array.prototype.pieces
may be to parts too
// lis
var arr = [1,3,5,4,7],
1 3 5 7
var arr = [2,2,2,2,2],
2
// interesting lcis solution https://codereview.stackexchange.com/questions/95455/longest-increasing-subsequence
function lis(a, r = [a[0]]){
if(!a.length) return r;
a.splice(0,1);
r[r.length-1] < a[0] && r.push(a[0]);
return lis(a,r);
}
var arr = [-7, -10, 6, 22, 9, 33, 21, 50, 41, 60, 80 ];
console.log(lis(arr));
etc
// original code from https://codereview.stackexchange.com/questions/95455/longest-increasing-subsequence
var arr = [-7, -10, 6, 22, 9, 33, 21, 50, 41, 60, 80 ],
lis = arr.reduce((p,c,i) => i ? p[p.length-1] < c ? p.concat(c): p : [c] ,[]);
console.log(lis);
// works
var arr = [-7, -10, 6, 22, 9, 33, 21, 50, 41, 60, 80 ],
lis = arr.R((p,c,i) => i ? p[(p#)-1] < c ? p|_|c: p : [c] ,[]);
console.log(lis);
// was fixing nth before etc with arrays and before doing two indices etc it got lost
// having array and should we have two searches? is before concat? and not map?
|5|.indexanddata((p,q,r)=>p==q?NE(r):EQ(r))
|5|.indexanddata((p,q,r)=>p==q?NE(r):EQ(r)).$_(SUM)
|5|.indexanddata((p,q,r)=>p==q?NE(r):EQ(r)).$_("SUM(x[3])"!)
|5|.indexanddata((p,q,r)=>p==q?NE(r):EQ(r)).$_("CONCAT(x[3])"!)
|5|.indexanddata(x=>x)
|10|.indexanddata().$(x=>x[1])
|10|.indexanddata().$(x=>x[2])
|10|.indexanddata().$(x=>x.zmapnode.zloc)
|10|.indexanddata().$(x=>x.zmapnode.zval)
|10|.indexanddata().$(x=>x.zmapnode.zresval)
|10|.indexanddata(x=>x).$(x=>x.zmapnode.zresval)
// something is not working right here.
|10|.indexanddata(x=>x).$(x=>x.zmapnode.zresval)
// the value is not same as an identity matrix
("5"!)
car={speed:3,weight:34};
(".speed"!)(car)
("[3]"!)+""
(".3"!)+""
("'3'"!)+""
(".'3'"!)+"" // went blank
some . number can be indexing. think.
// did not work right
a=(((1..10|.+|"x^")!))+"";
a=(((1..10|+|"x^")!))+"";
// why does it say b.multiply()
// should we allow string concat then?
//indexing
[3,2,4,5]#[3,3]
(1..100)#">10"!
((1..100)#">10"!)#TRUE
((1..100)#">10"!)#⊤
// not loading
https://images.zcubes.com/iconset/appicons/radarchart_4.svg
Need some way to take Excel date to JS etc.
EXCELDATE(45390)
TIME(EXCELDATE(45390.345) )
YEAR(TODAY())+""
giving issues in zblack
-see why.
-default should also work
(1..100)#">10"!
done 1d can be the dimension length
why is 1..10#3 giving time?
1..10#(1..10)
(1..10)#("x<5?x"!)#true
1..39@((1..40@(x=>"x<"+x))!)
1..39@((1..40@(x=>"x<="+x))!)
// how to make this give x+1, x+2 etc. MATRIXADD does not work as it tries to .multiply etc.
(1..10|.+|"x+y")
// other tests
{("z^3"!)}
{{(1,2,3,4,4)}}
(1..100)@SIN
("z^2")!(3)
// make ! binary to handle such situations too.
("z^2"!)(2) // works
https://stackoverflow.com/questions/49343024/getting-typeerror-failed-to-fetch-when-the-request-hasnt-actually-failed
// Include cors
const cors = require('cors');
// Use cors middleware
app.use(cors({
origin: '*', // Wildcard is NOT for Production
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
credentials: true,
}));
// treehouse numbers in numberphile channel
units.on;
a=EXP(1d1000)^(PI(1000)*SQRT(163d1000))
units.on;
a=EXP(1d1000)^(PI(1000)*SQRT((1..1000)<>d1000));
a~
// and search manually for different patterns like .99999 etc.
// how to avoid this error?
$>moment=require("moment")
function hooks() {
return hookCallback.apply(null, arguments);
}
$>MOMENT("JUL 21, 2020")
Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments:
[0] _isAMomentObject: true, _isUTC: false, _useUTC: false, _l: undefined, _i: JUL 21, 2020, _f: undefined, _strict: undefined, _locale: [object Object]
Error
at Function.createFromInputFallback (C:\beyemasterrates\node_modules\moment\moment.js:324:25)
at configFromString (C:\beyemasterrates\node_modules\moment\moment.js:2550:19)
at configFromInput (C:\beyemasterrates\node_modules\moment\moment.js:2993:13)
at prepareConfig (C:\beyemasterrates\node_modules\moment\moment.js:2976:13)
at createFromConfig (C:\beyemasterrates\node_modules\moment\moment.js:2943:44)
at createLocalOrUTC (C:\beyemasterrates\node_modules\moment\moment.js:3037:16)
at createLocal (C:\beyemasterrates\node_modules\moment\moment.js:3041:16)
at new hooks (C:\beyemasterrates\node_modules\moment\moment.js:16:29)
at 㫗㪴 (eval at <anonymous> (C:\snapshot\zblack\z3compiler.js), <anonymous>:1:259320)
at 㫗㲓 (eval at <anonymous> (C:\snapshot\zblack\z3compiler.js), <anonymous>:1:48744)
Tue Jul 21 2020 00:00:00 GMT-0500
$>new moment("JUL 21, 2020")
Tue Jul 21 2020 00:00:00 GMT-0500
$>
https://www.youtube.com/watch?v=GZuZgCDql6g
// split words and concat just 4 of them.
"Hello how are you?"#
#..4
-good effect
("Hello how are you?"#)#[1,2,3,4]
-not working as expected. as it splits every letter.
"Hello how are you?"#/\W+/
#1..4
"Hello how are you?"#/\W+/
#(..4)
"Hello how are you?"#/\s/
#(0..2)
(/\w+/g!)("Hello how are you?")
(/\w+/g!)("Hello how are you?")#1..2
// pieces into a function
1..10.pieces(3,SUM)
1..10.pieces(3,SUM,true)
// to look at and debug
//https://www.youtube.com/watch?v=8ynsN4nJxzU
x-matrix
a=[[2,0,0,1],[0,3,1,0],[0,5,2,0],[4,0,0,2]]
// why is (|4|)~ not showing a different matrix?
// are these looking ok?
(|4|).rotate(2)
(|4|).rotate(4)
(|4|) <+> (|4|).$$("x.reverse()"!)
// reverse seeme to have an extra index seems like
// did not work right. had nulls. check why.
(|4|).reverse().print()
// was fine to flatten it.
(|4|).$$(x=>x.reverse()).print()
// was not.
//possibly because $$ passes it as array.
(|4|) <+> (|4|).reverse()
// works fine. to get x-matrix.
//stride (slide, chunk and stride) divvy in haskell clojure partition
https://www.youtube.com/watch?v=-_lqZJK2vjI
// step is the chunk size
// need stride
// to look at sqrt and union
// operatorprecedence
// 34 sqrt tends to go to if(fnmatches.length>0) in if (node.type == 'CallExpression')and match with gmappings.callmappings
// union can be here too.
//
(1..10)∑(SQRT)
(1..10)∑SQRT
(1..10)∑("x"!)
(1..10)∑("x^2"!)
(1..10)∏("x^2"!)
(1..10)√
(1..10)∑ // did not cause error, but did not seem to parse.
(1..10)∏SIN
gmappings.callmappings also needs sigmas and products for lagging operators.
(MS(3)⋰)∪
MS(3)⋱
MS(3)±
// does this work?
KeywordToOperatorsReplacements
3 is 3
// is not parsing
1 isnt 3
1 to 100 by 0.1
SIN(1 to 100 by 0.1)
// adding new operators to language.
esprima.MapTermToOperator("equalsto","==")
3 equalsto 3
esprima.MapTermToOperator("plusplus","++")
x plusplus ;
plusplus x;
◰ // for unique from uiua
ADDOPERATOR("◰","UNIQUE")
ADDOPERATOR("◰","UNIQUE",1,"callfunctionunary","SUFFIX")
//ADDOPERATOR("◰","UNIQUE",1,"callfunctionunary","SUFFIX")
(1..10)◰
MS(4)◰
ADDOPERATOR("⍉","TRANSPOSE",1,"callfunctionunary","SUFFIX")
MS(4)⍉ ;
1..100.every(x=>x<400)
expand findindex and find to handle repeatedly
ADDOPERATOR("◫","Pieces",1,"callfunction");
(1..100)◫4
1..100.findx(">30"!,"TRUE")
ADDOPERATOR("⊚","Findx",1,"callfunction");
1..100⊚(">30"!)
// did not work.
ADDOPERATOR("◫","Findx",1,"callfunction");
fn=">20"!;
(1..100)◫fn;
Findx(1..100,ISPRIME,"ELEMENT")
1..100.findv("x>3"!)
1..100.findi("x>3"!)
1..100.finde("x>3"!)
1..100.findi("x>3"!,true)
1..100.findiv("x>3"!,true)
1..100.findiv("x>3"!)
-MINUS(MINMAX(1..100.findi(ISPRIME)))
a=[2,3,4,5,6,6,5,5,66,6,6];
a.finde("x>3"!) ∪
https://www.youtube.com/watch?v=8ynsN4nJxzU
m=[2 0 0 1; 0 3 1 0; 0 5 2 0; 4 0 0 2];
n=(m#)[0];
xm=|n| |+| |n|.reverse();
xm|==|(m.$("x!=0?1:0"!))
// did not work, but indexanddata is good to use
[2 0 0 1; 0 3 1 0; 0 5 2 0; 4 0 0 2]
.indexanddata(
(i,j,v)=>((i*1==j*1)?0:((v!=0)?1:0)),
undefined,
undefined,true
)
// is better
[2 0 0 1; 0 3 1 0; 0 5 2 0; 4 0 0 2]
.indexanddata(
(i,j,v)=>(EQ(i,j)?0:((v!=0)?1:0)),
undefined,
undefined,true
)
1..100.stride(5,2)
1..100.stride(5,2,UNDEFINED,true)
1..100.stride(5,2,SUM,true)
1..100.stride(5,2)
1..100.pieces(-2)
1..100.stride(2,-2)
h:=√∑([x,y]^2);
h(3,4)
w=[1,2,3;5,5,5;3,1,4];
MAX(w.$$(SUM))
"(1+(2*3)+((8)/4))+1"
s=("(1+(2*3)+((8)/4))+1"#/[^()]/).join("");
https://www.youtube.com/watch?v=pDbDtGn1PXk
(([-2,-1,0;-1,1,3;-1,2,4])⍌)
.findv(NEGATIVE)#
APL > to flatten
0 to nums to binary
then reduce
0..10.findv(ISZERO,true)
λB([SIN,COS])(45)
// todo
SUMR and SUMC?
or operator for .$$$ etc?
z=["--X","X++","X++"];
((z.join(";"))!)
https://www.youtube.com/watch?v=8Njxgy4itts
z="x=>{"+["--x","x++","x++"].join(";")+"}";
[0]@(z!)
// not working well. conversion to function has some issues.
https://www.youtube.com/watch?v=UogkQ67d0nY&t=1685s
My unofficial Strange Loop 2021 Conference Talk where I compare the functional and array programming paradigms.
m=[7,1,5,4];
MAX(m.across(m,MINUS)
.map((r,i)=>r.flatten().slice(i+1)))
m=[9,4,3,2];
MAX(m.across(m,MINUS)
.map((r,i)=>r.flatten().slice(i+1)))
m=[1,5,2,10];
MAX(m.across(m,MINUS)
.map((r,i)=>r.flatten().slice(i+1)))
(1..10)⍌[3,4]
(1..10)⍌4
(1..36) ⍌ SIN
(1..36) ⍌ [3,4]
MS(44)⍌ [3,400]
MS(44)⍌ SIN
(1..10)⍌4
(1..100)↓2
(1..100)↑1..5
(1..100)↑(1..5)
(1..100)↓1..5
⇤ and ⇥ ? for first and last?
(1..10)∏SELF
//did not work as SELF takes arguments. not based on itself so on an array it will have issues. as it is x i array format arguments
// now works after changing .map(f) to .map(x=>fn(x)) kind of format to avoid array argument.
MS(3).$$(PRODUCT)
[1..10].$$(PRODUCT)
±∑[1..45]
∑±[1..45]
(1..10)⇤
⇤(1..10)
// to try
⇟
min ↧
max ↥
(1..100)⇤
// first last etc.
(1..100)⇤(..3 )
(1..100)⇤2
(1..100)⇥3
(1..100)⇥
(1..100)⋮3
MS(3..14)≡SUM
MS(5)⋮SUM
// concat
(1..10)⧺(3..4)
[1..10]~≡(SIN)
[1..10]~≡(SUM)
MS(4)≡(SUM)
MS(4) ⋮ (SUM)
CHARCODE("testing")
CHARCODE("TEST")
CHARCODE(#a-z)
CHARCODE("THIS IS NOT NICE")
CHARCODE("THIS IS NOT NICE"#/\s/)
// why did not work as expected?
(1..10)≡⧺(2..4)
(1..10)≡⧺SUM
[1..10]≡⧺CONCAT
[1..10]≡⧺CONCAT
[1..10]≡⧺SUM
x=2..10
x.accumulatewith("x^2")
// how does this work?
// seems to use the array elements as an index than value, except the first access.
Check ArrayFrequencyRank
x=1..5
x.accumulatewith(SUM)
x=1..5
x.accumulatewith(CONCAT)
// it has first element by default twice. is that right?
x=1..5
x.accumulatewith(PRODUCT)
RANKS([100,32.2,54.01,210.3,32,45,54.01,76,10.002],4,5)
// need to research this which is used in WILCOKSONtest or so.
dat=[-2,-3,8,4,6,-4,-11,-2,-12,-6];
WILCOXONSIGNEDRANKTEST(dat,0,0.05,2,FALSE)
https://wiki.zcubes.com/WILCOXONSIGNEDRANKTEST
// check this out and see.
// rank seems to be off by ones
dat=[-2,-3,8,4,6,-4,-11,-2,-12,-6];
WILCOXONSIGNEDRANKTEST(dat,0,0.05,2,FALSE) ;
dat2=[
[188,186],
[177,171],
[176,177],
[169,168],
[196,191],
[172,172],
[165,177],
[190,191],
[165,170],
[190,191],
[165,170],
[180,171],
[181,188],
[172,187]
];
WILCOXONSIGNEDRANKTEST(dat2.column(0),dat2.column(1),0,0.05,2,TRUE);
//https://datatab.net/tutorial/wilcoxon-test try with this maybe
//https://datatab.net/tutorial/wilcoxon-test this page
// ranks seems off by one. do not understand the adding ranks part.
dat2=[
[43,44],
[36,38],
[43,41],
[41,39],
[37,34],
[37,41],
[43,39],
[40,34]
];
WILCOXONSIGNEDRANKTEST(dat2.column(0),dat2.column(1),0,0.05,2,TRUE);
[1..10]≡⧺SUM
[1..10]⋮⧺SUM
|5|.cumrows(2)
MS(4)≡SUM
[
2 3 4;
4 5 6;
4 5 66
]
≡SUM
[
2 3 4;
4 5 6;
4 5 66
]
⋮ SUM
12m<*>344cm
[[1,-2],[3,3],[0,44,-44]].branchvalues(false)
[[1,-2],[3,3],[0,44,-44]].branchvalues()
[[1,-2],[3,3],[0,44,-44]].branchvalues(["x<34"!])5
[[1,-2],[3,3],[0,44,-44]].branchvalues(["x<34"!])
[
[1,-2],
[3,3],
[0,44,-44]
].branchvalues(false).print()
[
[1,-2],
[3,3],
[0,44,-44]
].branchvalues().print()
[
[1,-2],
[3,3],
[0,44,-44]
].branchvalues("<4"!).print()
[
[1,-2],
[3,3],
[0,44,-44]
].branchvalues(">4"!,false).print()
[
[1,-2],
[3,3],
[0,44,-44]
].branchvalues([">4"!,"<4"!],false).print()
(-10..10).branchvalues([SIN,COS] )
// anywhere function goes to 0 like SIN does not project.
(-360°..360°..90°).branchvalues([SIN,COS] )
// COS does not hide because values are close to zero. but not zero.
(-360°..360°..90°).branchvalues([SIN,COS]@ROUND )
// works
[SIN,COS]@ROUND(34)
a=([SIN,COS]@[ROUND,CEILING]);
[90deg]@a
a=([ROUND,CEILING]@[SIN,COS]);
[90deg]@a
[
[1,-2],
[3,3],
[0,44,-44]
]⑂[NEGATIVE,ZERO,POSITIVE];
[
[1,-2],
[3,3],
[0,44,-44]
]⑂∅;
[
[1,-2],
[3,3],
[0,44,-44]
]⑂[ISNUMBER,ISBOOLEAN,ISEVEN];
[
[1,-2],
[3,3],
[0,44,-44]
]⑂[ISODD,ISEVEN];
UNICODESYMBOL("undefined",true) loses a char
(1..100)⇅;
a=1..100;
a⇅
[0,2,1,5,3,4]
a=[2,-1,0,1,-3,3,-3];
(a ⋱) ≡⧺ SUM
https://www.youtube.com/watch?v=U6I-Kwj-AvY&list=PLVFrD1dmDdvf8REa4SkI-IppFGvkRq83O
a=[-2,-1,-1,1,2,3];
(a ⑂ ∅) ≡ SUM
// why is null not closing and sum also not triggering
a=[-2,-1,-1,1,2,3];
a=a ⑂ ∅;
a ≡ SUM;
a ⑂ ∅ ≡ SUM; // did not work.
a=[-2,-1,-1,1,2,3];
( ⑂a) ≡ ∑ // worked
( a⑂) ≡ ∑ // did not work
a=[-2,-1,-1,1,2,3];
( a ∑) // works
( ⑂ ∑) // does not work
// should it be added to callunary too?
∑(34.4,4,5)
∑[34.4,4,5] // works, so (( may be ok. keep an eye on it. TODO look at this (( issue later.
∑(2,3..20) // has extra paranthesis
∑(3..20)
SIN∑(1..10) // to handle in platform by switching. but ok.
(2,3..20)∑(1..34)
//gives zero
(1..20)∑("x^3"!)
MS(4).$$(∑)
a=[-2,-41,-1,1,2,3];
( ∑a)
https://www.youtube.com/watch?v=XJ3QWOSZ8Nk
(1..5) ⑂ ISODD
// not working
(1..10).$(∑)
a(∑())
∑()
vs
SUM()
this.parseArguments()
new a.CallExpression(i,p) etc
1..100.parts(20).$$([∑,∏])
(∑()) // did not work
-it is trying to read arrow operator. But it is just paranthesis.
-should we make it look for call expression instead of binary?
a(∑(a,b)) has extra paranthesis.
SUM(a,b) is fine
∑(a,b) is not
a(∑[a,b])
became:
a(SUM([
a,
b
]));
a(∑(a,b))
parsed to
a(SUM((a, b)));
// see what to do with that.
-all seem to be working now
∑()
a(∑)
a(∑())
why is (∑) not parsing?
a(∑)
a(∑())
a(∑())
a(∑) works
a(∑()) did not work
a(∑1..10) even worked
a(∑(1..10))
a(∑()) fails
a(SUM()) works
a(SUM(1..10)) works
a(∑(1..10)) works
∑1..10 works
a(+3) works
(1..10) ∑( SIN)
fails but this may require z platform
∑(1..10)
(sum)
(+) does not, operator by itself fails. hence (∑) also does. how to handle this? maybe a good place to catch + as a function etc.
(+)
//parseGroupExpression ? catches the element here. + can be made to sum here for example.
(%)
CheckPrefixZ3SpecialNotations
// see what we can do for these. Maybe like % prefix, but atleast try how it holds up. but ++ etc.
https://www.youtube.com/watch?v=QtvvQ7MdwKY
s="This is a sentence which has a lot of words";
(s#" ")#(0..3)
.join("")
// how to join fast?
// make array join() as j?
// why did sring split by space not work?
s="This is a sentence which has a lot of words";
((s#" ")#(0..3))
.join(" ")
https://www.youtube.com/watch?v=k9BNn39gWiM
// try to solve.
x=[2,1,4];
COMBIN(x,1..3).$$(x=>PERMUTATIONS(x,3))
https://www.youtube.com/watch?v=k9BNn39gWiM
p=POWERSET([1,2,3]);
p≡ "[x.print(),↧x,↥x,↥x^2,∏(↧x,↥x^2)]"!;
p=POWERSET([2,1,4]);
//q=p≡"[x.print(),↧x,↥x,↥x^2,∏(↧x,↥x^2)]"!;
q=p≡"[∏(↧x,↥x^2)]"!;
q.*∑;
todo
https://www.youtube.com/watch?v=U6I-Kwj-AvY&t=1027s
https://www.youtube.com/watch?v=QtvvQ7MdwKY
https://www.youtube.com/watch?v=k9BNn39gWiM
why is EXCELTODATE not working in zblack?
1..10➕2..30
1m➕34cm
1..10 ➕ 2..4 // did not use 1..10 as + had similar behaviour to union character, as the series was not recognized.
(1..10) ➕ 2..4
a=1..10;
b=2;
a➗b
a=1..10;
b=2;
a ﹪ b
a=1..10;
b=2;
a ✖ b;
a=1..10;
b=2..4;
a ✖ b
a=1..10;
b=2;
a ∆ b
a=1..10;
b=3;
a ➖ b
a=1..10;
b=3m;
a ➖ b
b=(1..10)<>m;
b ∆ 3
b=(1..9)<>m;
b ∆ (1..9)
MS(3) ➕ 34
(1..10) ﹪ 3
##s a e=34;
sae+69
8..100.$(SIN).$(COS)
"test" ⧺ "test"
(1..10)⎙;
POWERSET("abc"#)
(1..10)⧺(3..4);
(1..103)∑
(1..103)∑SIN
// (1..10) ≡⧺ (2..13); did not work
(1..10).$(∑)
// did not parse
1..100 ∑
// did not parse
3!C!4
MS(4).$$(∑)
(1..10)~
stopped working.
(1..10)~
is now broken why?
∑(1..100)
// does not work
(1..100)∑
// does work
(1..10)∑(9,4)
// made it
SUM(FROMTO(1, 10));
(1..10)∑[SUM,MAX] // here SUM MAX does not make a difference, but ∑ for each element is applied with SUM and AVG so total is 55 for both!
(1..10)∑("x^2"!)
(1..10)∏("x^2"!)
∑1..100
∑(1..100)
(1..100)∑
∑()
a(∑)
a(∑())
//why is (∑) not parsing?
a(∑)
a(∑())
a(∑())
a(∑) //works
a(∑()) //did not work
a(∑1..10) //even worked
a(∑(1..10))
a(∑()) // fails
a(SUM()) //works
a(SUM(1..10)); //works
a(∑(1..10)); //works
∑1..10; // works
∑()
a(∑)
a(∑(a,b))
//why is (∑) not parsing?
a(∑)
a(∑())
a(∑())
a(∑) //works
a(∑()) //did not work
a(∑1..10) //even worked
a(∑(1..10))
a(∑()) // fails
a(SUM()) //works
a(SUM(1..10)); //works
a(∑(1..10)); //works
∑1..10; // works k
(1..10) ∑ SIN
1..10 ∑ SIN // does not work
// why did it not work?
1..100 = 1..10
// but this works
(1..10) = (1..10)
1.0009 ⩦ 1.30099 // floating point eq
10m= 1000cm
10m= 1100cm
https://www.youtube.com/watch?v=zrOIQEN3Wkk
(CHARCODE("(1+(2*3)+((8)/4))+1") ⑂ "x==40||x==41"!) ➖ 41
("(1+(2*3)+((8)/4))+1"#/[^()]/)
.join("")
// join character
("(1+(2*3)+((8)/4))+1"#/[^()]/)
s="(1+(2*3)+((8)/4))+1";
s#/[^()]/⚯ ""
symbol for CHARCODE
s="(1+(2*3)+((8)/4))+1";
(s#/[^()]/) ➖'('
⚯ ""
s="(1+(2*3)+((8)/4))+1";
v=(s#/[^()]/ ⚯ "")#;
v.$(⎀) ﹪ 3;
⚯ ""
(1..10)∑((a)=>[a^3])
s="(1+(2*3)+((8)/4))+1";
v=(s#/[^()]/ ⚯ "")⎀;
v﹪ 2 |-| 1;
// v=(s#/[^()]/ ⚯ "")#;
// v.$(⎀) ﹪ 3;
//⚯ ""
|3,30,1..10|⚯
##this is a test=1..34;
∑##this is a test
##this is a test=rad2piby45 ➕ 1;
∏##this is a test
// zplus eidt on this autocorrect deleted entire line and picked a greek
// may need to split greek on autocorrect
s="(1+(2*3)+((8)/4))+1";
v=(s#/[^()]/ ⚯ "")⎀;
(v ✖ 2 ) ➖81
//﹪ 2 ;
// v=(s#/[^()]/ ⚯ "")#;
// v.$(⎀) ﹪ 3;
//⚯ ""
s="(1+(2*3)+((8)/4))+1";
v=(s#/[^()]/ ⚯ "")⎀;
y=(v ✖ 2 ) ➖81;
[y]≡⧺SUM
s="(1+(2*3)+((8)/4))+1";
v=(s#/[^()]/ ⚯ "")⎀;
y=(v ✖ 2 ) ➖81;
NEG([y]≡⧺SUM )
https://www.youtube.com/watch?v=zrOIQEN3Wkk
//1 Problem, 8 Programming Languages (C++ vs Rust vs Clojure vs Haskell...)
//Maximum Nesting Depth of the Paranthesis
s="(1+(2*3)+((8)/4))+1";
v=(s#/[^()]/ ⚯ "")⎀;
y=(v ✖ 2 ) ➖81;
(NEG([y])≡⧺SUM)↥;
1116 1114
invert sign or
⧤
// do not work and not expected.
(1..10)#/abb/(x=>x)
(1..10)#/abb/ zplus [x=>x]
// may work
(1..10)#[/abb/ ""]
(1..10)#[["ab" "bbc"]]
ab~ 234
// do this appropriately.
// if just regexp, replace with ""
"343"⫳[/3/,""]
TRANSPOSEEXT(3, [
/3/,
""
])
s="(1+(2*3)+((8)/4))+1";
v=(s#/[^()]/ ⚯ "")⎀;
y=(v ✖ 2 ) ➖81;
(➖([y]≡⧺SUM ))↥
// why is max undefined if no ) was given.
(➖MS(4))
.print()
➕([-1,-2,33,4,5])
-gave confusing answers.
(➕([1,-2,33,4,-5])).print();
-gives just one answer.
-something confusing
(
([[
1,
-2,
33,
4,
-5
]]) ▦ ABS
)
.print()
-also was ok.
➕[-1,-2,33,4,5]
-was ok.
a=[-1,-2,33,4,-5];
➕a
a=[1,-2,33,4,-5];
a➕
// was also ok
"abcabc"⫳"a"
"abcabc"⫳"ab"
new RegExp("\s")
"abcabc"⫳"a"
"abcabc"⫳/a/
"abcabc"⫳/a/g
"abcabc"⫳[/a/g,"TEST"]
"abcabc"⫳[["ab","TEST"]]
"abcabc"⫳[[/a/g,"TEST"],[/b/g,"ABC"]]
s="(1+(2*3)+((8)/4))+1";
v=s⫳/[^()]/g;
https://www.youtube.com/watch?v=zrOIQEN3Wkk
s="(1+(2*3)+((8)/4))+1";
v=s⫳/[^()]/g;
((➖((v⎀)✖2➖81))≡⧺SUM)↥;
//s="(1+(2*3)+((8)/4))+1";
//v=s⫳/[^()]/g;
//((v#)⎀)✖2➖81; nc
["abcabc","bbcdbbc"]⫳/a/
["abcabc","bbcdbbc"]⫳/a/g
["abcabc","bbcdbbc"]⫳"a"
// replacement of pattern on the elements
["abcabc","bbcdbbc"]⫳/(ab|bc)/
["abcabc","bbcdbbc"]⫳/(ab|bc)/g
//these are just splits. not extracts or filters.
["abcabc","bbcdbbc"]#"a" // gave undefined. why?
"bbcdbbc"#"a"
"bbcsadbbc"#"a"
"bbcdbbc"#"b" // split by b
["abcabc","bbcdTESTbTbc"]⫳["a","TEST"] // zreplace
["abcabc","bbcdbbc"]⫳["a","TEST"] // zreplace
["abcabc","bbcdbbc"]⫳[["a","b"],"TEST"] // zreplace a with b, test with ""
["abcaTESTbc","bbcdaTESTabbc"]⫳[["a","b"],"TEST"]
["abcabc","bbcdbbc"]⫳[["a","TEST"]] // zreplace a with TEST
["abcabc","bbcdbbc"]≐["a"] // zmatch for each element here /a/g
["abcabc","bbcdbbc"]≐["a"] // zmatch show the matches only
//zmatched
["abcabc","bbcdbbc"]≅["a"] // zmatched elements
["abcabc","bbcdbbc"]≅["a","b"] //zmatched elements a and b
["abcabc","bbcdbbc"]≅["c","b"] //zmatched elements a and b
//zunmatched
["abcabc","bbcdbbc"] ≆ ["a"] // notmatched elements. a is the pattern.
//zmeached elements b
["abcabc","bbcdbbc"]≅["b"]
["abcabc","bbcdbbc"]≅["b","a"] // zmatched elements for a and b/g
["abcabc","bbcdbbc"]≅["a"] // zmatched elements for a
["abcabc","bbcdbbc"]≅["e"] // zmatched elements for e
["abcabc","bbcdbbc"]≅[["a","TEST"]] // zmatched elements for e
//zunmatched
["abcabc","bbcdbbc"]≆["e"] // zunmatched elements for e
["abcabc","bbcdbbc"]≆["a"] // zunmatched elements for a
["abcabc","bbcdbbc"]≐["a"] // zmatch
["abcabc","bbcdbbc"]≅[["a","TEST"]] // zmatched elements for a
["abcabc","bbcdbbc"]≅[["a","TEST"]] // zmatched elements for a
// match
["abcabc","bbcdbbc"]≐[["a","TEST"]] // zmatch elements for a TEST
// filter
// did not work
["abcabc","bbcdbbc"]≐[["a"],["b"]] // zmatch
["abcabc","bbcdbbc"]≐[["a"],["b"]] //zmatch
["abcabc","bbcdbbc"] ≗ [["a"],["b"]] // match only sequential. first do a, then b
["abcabc","bbcdbbc"] ≗ [["a"],["b"]] //zmatches element for a and b/g
["abcabc","bbcdbbc"] ≗ [["a"],["e"]] //zmatches element for a and e
ADDOPERATOR("⫳" , "ZREPLACE" , 1, "CALLFUNCTION" ,"NORMAL","REPLACE" );
ADDOPERATOR("≐" , "ZMATCH" , 1, "CALLFUNCTION" ,"NORMAL","MATCH" );
ADDOPERATOR("≗" , "ZMATCHES" , 1, "CALLFUNCTION" ,"NORMAL","MATCHES" );
ADDOPERATOR("≅" , "ZMATCHED" , 1, "CALLFUNCTION" ,"NORMAL","MATCHED" ); // ≅ ≗
ADDOPERATOR("≆" , "ZUNMATCHED" , 1, "CALLFUNCTION" ,"NORMAL","UNMATCHED" ); // ≅ ≗
["abcabc","bbcdTESTbbc"]⫳["a","TEST"] // replace a and TEST with ""
["abcabc","bbcdTESTbbc"]⫳[["a","TEST"]] // replace a with TEST
"(1+(2*3)+((8)/4))+1"≐[/[\(\)]/g]
v="abc";
(v⎀)✖2
// not parsing
s="(1+(2*3)+((8)/4))+1";
v=s⫳/[^()]/g;
(➖(v⎀✖2➖81)≡⧺SUM)↥;
s="(1+(2*3)+((8)/4))+1";
v=s⫳/[^()]/g;
(➖((v⎀)✖2➖81)≡⧺SUM)↥;
// did not work
➖81+3✖2
➖81➕ 3✖2
-81+3*2
Answer: 75
±34+4
a=-3;
±a+3
a=-3;
a+b±
a=1..100;
a↧;
(√4)..10
√4..10
sqrt works for entire series
desc ascending does not by default.
sign does not i think.
sqrt and sign prefix behaves differently for a series with ..
± a..b -first
√ a..b -all
though both have same precedence
'±': 12, // plus minus etc. has close precedence.
'√': 12, // sqrt etc. and even nth root. (just as exponentiation).
'..': 8 precedence
though (1..4)√(4..10) had to have brackets to work.
4√4 was ok
// works
s="(1+(2*3)+((8)/4))+1";
v=s⫳/[^()]/g;
(➖(v⎀)✖2 ➕ 81≡⧺SUM)↥;
(radpiby180 ➕180) ~
√[(1..20),(4..30)]↥
√(1..20),(4..30)↥
[√(1..20),(4..30)↥]
↥(4..30)
(4..30)↥
(4..30)↥3
↥4..30
for entire array
4..30↥
for 30 only
⋰4..30
4..30⋰
43 ↥ 344 + 35 ↥ 45 // max has lower precedence than + etc.
43 √ 344 + 35 √ 45 // sqrt has higher precedence than + etc.
// in binary, which makes sense?
4↥5
esprima.AddNewOperatorToZ3("..",10)
appears .. operator precedence does not make a difference as it is not checked while parsing, as it goes with number parsing etc.
√ 344 + √ 45
// parses confused.
SQRT(344 + SQRT(45));
how to avoid this?
√344 + 45 +c
// also issues. sqrt precedence does not apply here.
// should possibly parseUnary than Binary here?
5√344*45+c
sqrt parsing goes for entire expression
5 ↥ 344*45+c
also does the same
3+∑(344*45)+c
-is ok. otherwise it gets the entire expression.
-3∑(344*45)+c
-did not even parse right. APPLYFNAGGSUM(3, 344 * 45 + c); precedence may be overdone in binary case
a+∑(344*45)+a∏c
parsed as APPLYFNAGGPRODUCT(a + SUM([344 * 45]) + a, c);
(a)∏(c) +a+∑(344*45)
becomes APPLYFNAGGPRODUCT(a, c + a + SUM([344 * 45])); why?
a∏c+a+∑(344*45)
// works now
3∑(SIN)+c
-did not work
(1..3)∑(SIN)+34
-works
-how to make prior 1..3 to be without brackets if possible.
1..43↥ 344 + 35 ↥ 45
-ignores 1..43
1..43↥ 344 + 35 ↥ 45
-how did this parse to ignore the first part?
1..43↥344
-itself does not parse
(1..43)∑
-works
-how does .. work?
Compare:
SUM∑1..12
1..12∑SUM
parseLeftHandSideExpressionAllowCall
..
(1..12)+∑(SIN)
// keeps 1..12
vs
1..12+∑(SIN)
// skips 1..12
1..12+∑SIN
// lost 1..12 why?
(1..12)∑SIN
// works
a+∑SIN
// works
a+1..2∑SIN
a+1..2∑SIN
1..12∑SIN
// does not work even with precedence of 12
(1..12)∑SIN
-ok at precedence of 12
a+1..2∑SIN
//worked
1+(..12)∑SIN
//worked
a..b^3
(1..12..4)+a+∑SIN
// worked
1..12..4+a+∑SIN
-failed
(1..12..4)+a+∑ ∏ √ SIN
2∑SIN
1..2∑SIN
a+1..12.3...4
y
a+1..12.3..4
x
a+(1..12.3..4)∑SIN
a+∑1..12.3..4
a+∑(1..12.3..4)
1..2∑SIN
1..2∑SIN
(1..2)∑SIN
// the extra paranthesis is causing the confusion.
)] etc.
GCD(20,15)
// fork gave issues
[-2,-1,-1,1,2,3] ⑂ ;
[-3,-2,-1,0,0,1,2]⑂;
[5,20,66,1314]⑂;
[[-2,-1,-1,1,2,3] ⑂ ,
[-3,-2,-1,0,0,1,2]⑂,
[5,20,66,1314]⑂
];
[-2,-1,-1,1,2,3] ⑂ NEGATIVE
[-2,-1,-1,1,2,3] ⑂ POSITIVE
[-2,-1,-1,1,2,3] ⑂ [POSITIVE,NEGATIVE]
// fork suffix had issues.
⑂[-2,-1,-1,1,2,3];
"abc" ⚯ "dec"
("abc"#) ⚯ "dec"
// join puts between concats
xx
a=[2,-1,0,1,-3,3,-3];
(a ⋱ ≡⧺ SUM)↥; // did not work
// had to be corrected to
((a⋱) ≡⧺ SUM) ↥ ;
"test" ⧺ "test" ⧺ "test"⧺ "test"⧺ "test"
//does not parse anymore.
a=[2,-1,0,1,-3,3,-3];
((a⋱) ≡⧺ SUM)↥ 4;
what is good count character?
⋱a;
a⋱; // did not work
why 4 descending fn rows?
and why did it not kick in?
a⋱
⋱a
a⋱v;
etc parses now
(1..10)⨱; // average
a=1..10;
a ⨱; // average
a ⨭; //stdev
a ⨮; //stdevp
a ⨴; // var
a ⨵; // varp
MS(3) ≡ ⨱ // average of each line.
a=[-1,-2,-3,4,3,2,1];
(a±)∏
//why does a±∏ not work?
// i think because of the operator check etc.
// need to see what we can do there.
// operator check should be just for ] ) etc.
a±∑∑
∑±a
b=(±)@(∑);
b(1..100)
a(±➕∑➕∑)
(a±)∑
±⊕∑⊕∑
(±⊕∑)(1..10)
(±⊕∑)(1..10)
[2..3,4..5]@CHIDIST
[2..3,4..5]±
([2..3,4..5]±) ∑
∑±[2..3,4..5]
(⊕[SUM,SIGN])(1..10)
1..100@[SIN,"x^2"]
[1..100]@[SIN,"x^2"]
SIN(1..20)
(±⊕∑)
1..10.$(±)
// did not work
1..10.$(∏)
- this also works.
(∑⊕⨱)
(∑) ⊕ (⨱)
(∑⊕⨱)
(SUM⊕AVERAGE)
(COUNT⊕SIN)(1..5)
SIN(5)
(SUM⊕COUNT)(1..5)
// why is the parsing different?
∑⊕⨱
∑*⨱
// * to avoid + or -ve unary issues
esprima.parse("∑*⨱")
esprima.parse("∑+⨱")
// has issues due to unary
// much like
esprima.parse("∑⊕⨱")
∑⊕⨱
translates to
SUM(AVERAGE * undefined);
with multiply replacement.
∑*⨱
SUM * AVERAGE;
∑+⨱
SUM(+AVERAGE);
∑±⨱⨸(1..100)
// works
a∑±(1..10)
// loses sum
// likely unary isue
a.in(Zx)
vs
a.is(Zx)
a.∑(Zx)
a=1..10;
a["=="]=SUM;
a["=="](a);
∑*⨱
PIPEFUNCTIONS(⨱,∑)(1..10)
[1..10]±;
// not working.
[1..10]∑;
1..10∑;
// also not working.
10∑SIN; .. need to make APPLYFNAGGPRODUCT into array to start the process
(1..10)∑
// works now
[1..10]∑
// works now
(1..10)∑SIN
(([1..10])∑)±
// works with ))
∑ ⊕ ⨱
-still not working
a∑±(1..10)
works
∑±(1..10)
//works
∑±(-5..10)
//works
∑*⨱
√ ⊕ ⨱
∑ ⊕ ⨱
∑@⨱
⨱ ⊕ ∑
√ ⊕ ⨱;
√ + ⨱;
√ * ⨱;
√ ⊕ [⨱,⨱];
√ ⊕ ⨱;
∑ ⊕ [⨱,⨱];
SUM ⊕ AVERAGE
(∑) ⊕ ([⨱,⨱]);
a=1..10;
a.∑(3)
.) as a way to close brackets?
esprima.parse("1..a.)(3).)")
esprima.parse("a.)(3).)")
esprima.parse("1..a.).print()")
a=1..10;
1..a.).print()
1..100.).∑(SIN)
2..20..2.)@SIN
2..20..2.)∑
1..a.*SUM
1..10.)(∑).)(SQRT)
// not yet.
1..10.).$(SIN)
1..10.].].$(SIN)
1..10.].].].$(SIN)
a=1..10;
a.).$_(∑)
a.*SIN()
a=1..100;
a.*SUM()
a=1..100;
a.*SUM().*SQRT()
a=1..100;
a.*SUM()
a=1..100;
a.].*∑.*⨱
x={a:2,b:33};
x.*(["x^2","z^3"])
(1..100) .* ["x^2","x^4"]
MAGICSQUARE(5) .* ["x^2","x^4"]
MAGICSQUARE(5) .* "x^2"
a=1..100;
a.*SUM();
x={a:2,b:33};
x.*(["x^2","z^3"]);
x⊨(["x^2","z^3"]);
a=1..100;
a.*SUM();
x={a:2,b:33};
x.*(["x^2","z^3"]);
x⊨(["x^2","z^3"]); // apply to keys
x=1..10;
x⊨(["x^2","z^3"]);
SUM⊕SIN⊕COS
esprima.parse("SUM⊕SIN")
(SUM⊕SIN)(1..4)
(SIN⊕SUM)(1..4)
[[
SUM,
COUNT
], DIVIDE]
.$fnx() (1..3)
// did not work
[
SUM,
COUNT
], DIVIDE.]
.$fnx() (1..3)
a=SUM⊕SIN.);
a(34)
// average with phi combinator
([
SUM,
COUNT
]⊕ DIVIDE)(1..10)
3⧓[3,4]
//why error for between?
a=-1;
⧓(1,a,30)
a=29;
⧓(1,a,30) //between g
a=31;
⧒(1,a,30) //xlbetween g
a=30;
⧒(1,a,30) //xlbetween g
⧒(1,2,30) // xlb g
⧒(1,1,30)
a=29;
⋈(1,-1..31,30);
⧓(1,-1..5,4);
[
⧓(1,1,30),
⧓(1,0,30),
⧓(1,10,30),
⧓(1,31,30),
⧑(1,29,30),
⧑(1,30,30),
⧑(1,1,30),
⧑(1,30,30),
⋈(1,1,30),
⋈(1,3,30)
]
do{}until()
works
but
while(){}
does not
when(condition){ clauses}
//works
while(a<b){ c=a+b};
until(a<b){ c=a+b};
a=undefined;
a?=3;
1..20.]@@SIN
1..20***4
134==>a;
a<==134;
a<<<MS(3)
TODO
CHECK ON This
a=|3|;
a<<<MS(3)
MATRIXASSIGN does it work?
a=1.234445;
a ≈3;
a=13+34i;
a!
a=13+34i;
a<^>3
MS(4)~
MS(4)%
1.3%%4;
1.3%%4 ➕2%%3
MS(3)|.*|MS(3)
MS(3).*SUM
(8..100)^2
8..100.)^2
//did not work
(8..100)^2
// works
8..100.)+3
//did not work
a.)^3
a.)+3
// worked
1..100.).)^3
// issues
a=1..100;
a.*SUM;
//works
a=1..100.];
a.*SUM;
1..100.]^2
1..100.].)^2
// did not work
[1..100].)^2
a=([1..100])^2;
// does not look right. why?
POWER([1..100]~,3)
// this works
[1..100]@SIN
[[1..100]]@SIN // same issue as power
// could not explain it.
a=[1..3].]^2
a=[1..3].]^3
// in ko titles came. in prod it did not.
in prod, we did not get the help
-after full load it worked.
-why did it not work and showed chinese characters?
a=(-300..100);
a.*±
// did not work in zcubes prod
a=1..100;
a.*SUM()
a=1..100;
a.*SUM();
a=1..100;
a.*SUM();
a=1..100;
a.*∑();//did not work
a=1..100;
a.*SUM();// worked
a=(-300..100);
a.*SIGN()
a=(-300..100);
a.*±() // did not
a.*±()+b
a.*±()+b
// correct behaviour
(a.*∑)+b
a.*±
-has undefined.
a.*∑*SUM(a)
±∑ ∏(-1..100)
([-1..100].*∑.*∏) +34
±∑ ∏(1..100)
a.*±(+b)
(a.*±(a))
1..10.)⧻
CHIDIST(1..3,2..3)
a.*➕()
// has issues
a.*➕
// had undefined there.
a=1..100;
a.*➕;
a.*±;
[[1..100]]@UNITADD
a.*+;?
has issues.
(1..100).*∑ broke
+ should it map to a third for prefix or function by itself?
// + gave ABS(undefined). why?
(([[1..100]]).*∑) +""
a=1..10;
a.*➕;
a=-1..10;
a.*±
a=1..100;
a.*SUM()
a=1..10;
a.*➕;
a=1..10;
a.*➕();
a=1..10;
a.*➕(3)
a=1..10;
a.*➕(3);
a.*SUM(34).*SQRT()
a.*SUM(3);
a.*∑(3)
a.*➕(3)
a.*±(3)
a.*∑(3)
// BinaryExpression etc.
// works
a.*±(3)
a.*±()
// SIGN a, undefined etc
// works
a.*±
// became just the SIGN
// all four below works
a.*±;
a.*±() ;
a.*±(b) ;
a.*±(b,c) ;
a.*SUM; // not kicking in
a.*SUM() ;
a.*SUM(b) ;
a.*SUM(b,c) ;
a.*∑(b) ;
a=1..100;
a.*SUM();
a.*SUM(3);
// not working.
1..100.*∑()
1..100.*SUM(b,c) ;
1..100.*SUM()
// do not work
(1..100).*SUM()
// works
1..100.*SUM()
make it work like
1..100@SUM()
1..100.$(SIN)
1..100.*SIN
1..100.*SUM(4)
1..100.*∑(3,4,5,5)
// works now.
// these behave slightly differently as APPLYTOKEYS
1..100.*[SIN,COS]
1..100.*[SIN,COS,"x^2"]
SUM(1..100)
a=1..100;
a.*SUM;
a.*∑; // did not work without ()
a=1..100;
a.*∑(8)
a=...100;
a.*∑(8)
a=1..10;
a.*➕;
// worked
// broken
|4||+||4|
|4||+||4|
⊕(∑, √, ⨱)
∑ ⊕ ⨱
∑ ⊕ (AVERAGE)
∑ ⊕ (AVERAGE)
∑ ⊕ AVERAGE
∑ ⊕ ∑
a=(⊕(∑, √, ⨱));
a(1..50)
⨱(√(∑(1..50)))
a=(⊕(∑, √));
a(1..5)
a=⊕(∑, √, ⨱);
a(1..50)
a=∑⊕√;
a(1..50)
// sum symbol does not seem to switch back etc. may need enter process.
a = FUNCTIONSTREAMS(∑, SQRT);
a(FROMTO(1, 50));
// some operator mapping?
|3,4,5,2..45||.*||3,4,5,20..45|
MS(5)|.*|MS(5).fillwith(3..304)
1..4.$(SIN)
SIN(rad2piby360)
SIN(rad2piby360).graph()
1..100.*⨱()
f=[SUM,Length]⊕DIVIDE;
f(1..10)
(("x^2"!) ⊕ ("x^3"!))(5)
("<4"!)@(1..30)
1..100.).∑ .⨱
// did not convert the symbols
1..100.∑ .⨱
1..100.*∑()
1..100.*∑
1..100.*⧻(3,4,5,5)
2..20..2.)∑
//became SUM(FROMTO(2, 20, 2));
2..20..2.∑
//became FROMTO(2, 20, 2).∑;
2..20..2.*∑
2..20..2.).*∑
// not working (only SUM)
2..20..2.*∑()
2..20..2.∑
(2..20..2)∑
POWERSET([1,2,3]).print()
https://www.youtube.com/watch?v=SpZJxbOf_jM
a=[1,2,3,4];
b=[2,7,1,19,18,3];
a=[1,2,3,4];
b=[2,7,1,19,18,3];
x=a;
n=x#;
i=a|%|n;
// MATRIXMOD did not seem to work for 3%4 etc.
3%4
[1..2]|+|[1..1]
// fails because the right side did not adjust the length. how to handle it?
a=[1,2,3,4];
b=[2,7,1,19,18,3];
x=a;
n=(x#1)[0];
i=a|%|n;
//https://www.youtube.com/watch?v=SpZJxbOf_jM need to work on this.
a=[1,2,3,4];
b=[2,7,1,19,18,3];
x=b;
n=(x#1d)[0];
i=n|%|x;
a=[1,2,3,4];
b=[2,7,1,19,18,3];
x=b;
n=(x#1d)[0];
x.indices()
i=x|%|n;
// can indices do just dimensionally?
// did not parse.
1..10.indices(∅) // did not parse for null
a.indices(∅)
∅ works
(∅) does not.
esprima.parse("(∅)")
// lookahead did not detect )
a=1..10;
a.indices("!x%3||!x%5"!)~
a=∅;
ISNULL(null)
and IFNULL seems to have same code.
a=∅;
ISNULL(null,"abc")
1..10≐("!(x%3)||(!x%5)"!)
//callstack error
(x=>(x%3==0)||(x%5==0)) (4)
f="(x%3==0)||(x%5==0)"!;
1..4.$(f)
a=[1,2,3,4];
b=[2,7,1,19,18,3];
f="(i%3==0)||(i%5==0)?x"!;
a.m((x,i)=>f(x,i))
b.m((x,i)=>f(x,i))
a=[1,2,3,4];
b=[2,7,1,19,18,3];
x=b;
f="(x%3==0)||(x%5==0)"!;
m=1..(x#).$(f);
b ≐ m
// max call exceeded.
a=[3,2,4,5];
r={};
a.m("r[i]=k"!)
2..20..2.∑
-gives FROMTO(2, 20, 2).∑ and will not run.
a.)
a.].];
(8..100)^2
a.].].].].];
a=24;
a.].].].].];
a=24;
a.].].].].].print();
//https://www.youtube.com/watch?v=i1K_kUKJnE4
Left and Right Sum Differences
i=1;
n=(xs#1d)[0];
a=[0].concat(xs#(0..(n-2))) ≡⧺(SUM);
b=[0].concat(xs#((n-1)..(1)..-1)) ≡⧺(SUM); b.reverse() ;
(a|-|b).$(ABS);
xs=[10,4,8,3];
i=1;
n=(xs#1d)[0];
a=[0]⧺ (xs#(0..(n-2))) ≡⧺(SUM);
b=[0]⧺(xs#((n-1)..(1)..-1)) ≡⧺(SUM); b.reverse() ;
(a|-|b).$(ABS);
xs=[10,4,8,3];
i=1;
n=(xs#1d)[0];
a=[0]⧺ (xs#(0..(n-2))) ≡⧺(SUM);
b=[0]⧺(xs#((n-1)..(1)..-1)) ≡⧺(SUM);
b⤽() ;
(a|-|b).$(ABS);
1..5.)⤽
(1..5)⤽
(((1..5)⤽)⤽)⤽
https://www.youtube.com/watch?v=SpZJxbOf_jM&list=PLVFrD1dmDdvd_rChH0L1jeMVZpJ8ZIivE
a=[1,2,3,4];
b=[2,7,1,19,18,3];
x=a;
n=x⧻;
m=n|%|(1..n)
x.mask(m)
i=a|%|n;
// MATRIXMOD did not seem to work for 3%4 etc.
3%4
a=[1,2,3,4];
b=[2,7,1,19,18,3];
x=a;
n=x⧻;
m=NOT(n|%|(1..n));
∑((x◍m)^2);
x=b;
n=x⧻;
m=NOT(n|%|(1..n));
∑(x.mask(m)^2);
∑(x.mask(m)²);
∑((1..10)²)
(1..10)².* ∑
a=90;
b=a ²;
a=90;
b=a¹²; // becomes a12
// space required
units.on;
h:=SQRT(a^2+b^2);
h(6mi,7cm)<>mi
units.on;
h:=√(a^2+b^2);
h(6mi,7cm)<>mi
SQRT and √ give same but different looking results.
(1..100)◍[0,1,0,1,0,1]
Ƒ a1(a,b)
{
return(a+b)
};
a1(4,5)
a=13+34i;
a ³
https://www.youtube.com/watch?v=3o4RR9TKdFc
strs=["flower","flow","flight"];
((strs▦("x#"!))~≡(UNIQUE@Length)).whereindex(">1"!)
Answer:
2
strs=["dog","racecar","car"];
((strs▦("x#"!))~≡(UNIQUE@Length)).whereindex(">1"!)
Answer:
0
https://www.youtube.com/watch?v=0mtvTmzcT2s
Difference Between Ones and Zeros in Row and Column
diff[i][j]=onesRowi+onesColj-zeroRowi-zerosColj
g=[[0,1,1],[1,0,1],[0,0,1]];
https://www.youtube.com/watch?si=zfcq0JEqpT2I60iD&v=ec1Rsn5JvnY&feature=youtu.be
BQN: Explicit to Tacit
snake-in-matrix
https://leetcode.com/problems/snake-in-matrix/description/
D=
{
"left":[-1,0],
"right":[1,0],
"up":[0,-1],
"down":[0,1]
};
m=["DOWN","RIGHT","LEFT"];
n=3;
mx=|n,n,0..(n ²)|
m@"D[x]"!
//mx#(m@"D[x]"!)
(m~)@(x=>D[x])
//mx#(m@"D[x]"!)
m.$(x=>DIRECTIONS[x])
(m~)@(x=>DIRECTIONS[x])
//mx#(m@"D[x]"!)
("DIRECTIONS[y]"!)+ ""
("LEFT")
m.$(x=>DIRECTIONS[x])
// (m~)@(x=>DIRECTIONS[x])
// //mx#(m@"D[x]"!)
// ("DIRECTIONS[y]"!)+ ""
// ("LEFT")
m.$(x=>DIRECTIONS[x]);
m.$(x=>DIRECTIONS[x])⋮⧺SUM
m.$(x=>DIRECTIONS[x]);
m.$(x=>DIRECTIONS[x])⋮⧺((x,y)=>x||0+y||0)
// seems not do to -1 here.
m.$(x=>DIRECTIONS[x]);
ms=m.$(x=>DIRECTIONS[x]);
ms⋮⧺SUM
m.$(x=>DIRECTIONS[x]);
ms=m.$(x=>DIRECTIONS[x]);
ms⋮⧺SUM
ms.cumcolumnswith(SUM);
ms.cumrowsswith(SUM);
these look a bit confusing. check.
// symbol was wrong on editor ko z3
ms.$$$(SUM)~
mx#ms.$$$(SUM)~
D=
{
"LEFT" :[-1,0],
"RIGHT" :[1,0],
"UP" :[0,-1],
"DOWN" :[0,1]
};
DIRECTIONS=D;
m=["DOWN","RIGHT","LEFT"];
n=3;
mx=|n,n,0..(n ²)|;
(D#[m])[0]
mx#ms.$$$(SUM)~
// array indexing to object keys?
D=
{
"LEFT" :[-1,0],
"RIGHT" :[1,0],
"UP" :[0,-1],
"DOWN" :[0,1]
};
DIRECTIONS=D;
m=["DOWN","RIGHT","LEFT"];
n=3;
mx=|n,n,0..(n ²)|;
m.$(x=>DIRECTIONS[x]);
ms=m.$(x=>DIRECTIONS[x]);
ms⋮⧺SUM
ms.cumcolumnswith(SUM)~ ~ ~;
ms.cumrowsswith(SUM);
m.$(x=>DIRECTIONS#x);
mx#ms.$$$(SUM)~
(DIRECTIONS#[m]).print()
(DIRECTIONS#[m])[0]
ms=(D#[m])[0]
mx#ms.$$$(SUM)~
D=
{
"LEFT" :[-1,0],
"RIGHT" :[1,0],
"UP" :[0,-1],
"DOWN" :[0,1]
};
DIRECTIONS=D;
m=["DOWN","RIGHT","LEFT"];
n=3;
mx=|n,n,0..(n ²)|;
ms=m.$(x=>D[x]);
mx#(ms ⋮SUM)~
// solution
D= {
"LEFT" :[0,-1],
"RIGHT" :[0,1],
"UP" :[-1,0],
"DOWN" :[1,0]
};
DIRECTIONS=D;
m=["DOWN","RIGHT","LEFT"];
n=3;
mx=|n,n,0..(n ²)|;
ms=m.$(x=>D[x]);
mx#(ms ⋮SUM)~
[mx]#(m@"D[x]"!)
// this still gives some issues
todo
find why "D[x]"! did not parse
("[x,D[x]][0]"!) + ""
// had errors
(0..(n ²))#((∑(D#[m])[0])~
this too:
(0..n ²)#(∑(D#[m])[0] )~
// works
(0..n ²)#∑((D#[m][0])~)
subscript by itself to index.
or with space
x abcdef
uppercase had issues
x Hello how are you?
selection can be used for help etc. with token maybe?
"D[x]"!
t=WalkAST(SUM+"")
t.map(x=>typeof window(x[0]))
arguments
err
-maybe in catch objects etc.
SUM etc.
D avoid based on z standards
t=WalkAST("D[x]<4")
∑((2..200)#1..10)
abcd=23;
abcde=23;
abcdef=23;
abcdefh=23;
abc=23;
ab=24;
f4:=ab+445+abc+abcd+abcde+abcdef+abcdefh;
("D[x]<4"!)+""
// abcd=23;
// abcde=23;
// abcdef=23;
// abcdefh=23;
abc=23;
ab=24;
f4:=ab+445+abc+abcd+abcde+abcdef+abcdefh;
("ab+445+abc+fe+ef+abcd+FE+E+abcde+abcdef+abcdefh;"!)+""
// this works.
D= {
"LEFT" :[0,-1],
"RIGHT" :[0,1],
"UP" :[-1,0],
"DOWN" :[1,0]
};
DIRECTIONS=D;
m=["DOWN","RIGHT","LEFT"];
n=3;
mx=|n,n,0..(n ²)|;
ms=m.$("D[x]"!);
mx#(ms ⋮SUM)~
[a].).$(SUM)
[a].$(SUM)
a.].).$(SUM)
1..100.$(SUM)
1..100.).$(SUM)
m=["DOWN","RIGHT".],"LEFT"];
m=[["DOWN","RIGHT"].].],"LEFT"];
m="RIGHT".].].].].].].];
m="RIGHT".).).).).).);
https://symbl.cc/en/unicode-table/#general-punctuation
reciprocal symbol ⅟ x
minus ╍ ⏔ ⏔
divide ⌿
pieces ⇻ ⁜
parts ⁂ ※ chunks
permilli ‰ ‱ etc
ᚔ
// trying
(1..10)⅟
a=1..100;
⅟a
a=[1..100]~;
⅟a;
╍(1,4)
100‰
100‱*1
1‰*1
a=14;
a‰
a=14;
a‰*1
(1..100)※12
(1..100)⁂(12)
(1..100)⁜(12)
// both did not work
(1..100)⁜[12,SUM]
(1..100)⁜(12,SUM)
// need .* SUM
(1..100)⁜12 .* SUM // works
(1..100)※10 ≡ SUM
(1..100) ⁂ 10 ≡ SUM
a=(1..100);
⅟a
a=(1..100);
a ⪢ "."
a=(1..100) ⪢ "yx";
a ⪡ "x"
a=(#a-z) ⪢"xy";
a=(1..100);
(a ⪢ ".") #"."
𝕏=1..100;
⅟𝕏
m=[4,2,9,4,3];
-(⇅(m.findi(ISPRIME)))╍
1..100.].$$(SUM)
works though
[..100] ≡SIN
-works
(1..15)➕[10..14]
[(' sfdsf sdf sdf sd sd sd sd ')⇺,
(' sfdsf sdf sdf sd sd sd sd ')⇻,
(' sfdsf sdf sdf sd sd sd sd ')⇼
]
[' sfdsf', 'sdf ',' sdf ']⇺;
[' sfdsf', 'sdf ',' sdf ']⇻;
[' sfdsf', 'sdf ',' sdf ']⇼;
ADDOPERATOR("⇺" , "LTRIM" , 12, "CALLFUNCTION","SUFFIX", "LTRIM");
ADDOPERATOR("⇻" , "RTRIM" , 12, "CALLFUNCTION","SUFFIX", "RTRIM");
ADDOPERATOR("⇼" , "TRIM" , 12, "CALLFUNCTION","SUFFIX", "TRIM");
fix () on the right of a callmember function
https://www.youtube.com/watch?v=APdKFJkmBbM
a=["abc","aabc","bc"];
b=["ab","a"];
c1=(a⚯"")#;
c=FREQUENCY((a⚯"")#)
FrequencyMap(['a', 'b', 'c', 'a', 'a', 'b', 'c', 'b', 'c'],0)
?
𝑓 frequency each
maybe with bin too?
COUNTEACH?
FREQUENCY bins_array Required. An array of or reference to intervals into which you want to group the values in data_array. If bins_array contains no values, FREQUENCY returns the number of elements in data_array.
though if bins_array is undefined, we can use it to count each key.
a=["abc","aabc","bc"];
b=["ab","a"];
c1=(a⚯"")#;
c=𝑓((a⚯"")#);
[" abc "," aabc "," bc "]⇼;
𝑓[" abc "," aabc "," bc "]; becomes MATRIXGET(𝑓, " abc ", " aabc ", " bc ");
2[" abc "," aabc "," bc "];
([3,4,5])(2);
// what does MATRIXGET do?
MATRIXGET(SomeMatrix,accesslist)
𝑓([" abc "," aabc "," bc "])
a=["abc","aabc","bc"];
b=["ab","a"];
c1=(a⚯"")#;
c=𝑓((a⚯"")#);
a=["abc","aabc","bc"];
b=["ab","a"];
c=𝑓((a⚯"")#);
keys to array etc.
a=["abc","aabc","bc"];
b=["ab","a"];
c=𝑓((a⚯"")#)#;
a𝑓=2;
a𝑓^3
⩸a
//c1=(a⚯"")#;
a=["abc","aabc","bc"];
b=["ab","a"];
c=(((a⚯"")#)⍣) #;
a=["abc","aabc","bc"];
b=["ab","a"];
c=(((a⚯"")#)⍣)#;
how to make f the symbol for frequency? How to add characters to the compiler?
⍣
how to get column 1
?! operator?
MS(4)#[[2]]
how to extract columns?
[*,2]
// not working.
1..100.) ≡ (SUM)
1..100 ≡ (SUM)
//works
a=1..100;
a≡ (SUM)
(1..100)≡SIN
(1..100.])≡SIN
MS(4)#[3c]
MS(4)#[3n]
MS(4)#[3n] for columns
//IsBigInt for columns? Do we make 1d behave like 2d?
in ARRAYFY function
(MS(4)#3) .print()
(MS(4)#3n) .print()
// note 61: same as note 62 also for 3n etc. to give columns
(MS(4)#1n..3n)~) .print()
((MS(4)#[3n])~) .print()
(MS(4)#3n) .print()
(MS(4)#3) .print()
(MS(4)#(1n..3n)) .print()
MS(4)#3n
MS(4)#3
// columns are extracted as rows. to make it columns, transpose it.
a=MS(4)#3n ;
a.print()
a=MS(4)#3n ;
(a~).print()
a=MS(4)#(1n..3n) ;
(a).print();
(a~).print()
a=MS(4)#[1,2n];
a=MS(4)#[1,[1,2n]];
// in sequential indexing, we do not care about BigInt etc.
a=["abc","aabc","bc"];
b=["ab","a"];
c=((((a⚯"")#)⍣)#1n)∪;
(c#1d)[0]==1
SAME function and symbol
#?
regexp predefined?
a=["abc","aabc","bc"];
b=["ab","a"];
c=((((a⚯"")#)⍣)#1n)##;
a=["abc","aabc","bc"];
b=["ab","a"];
c=((((a⚯"")#)⍣)#1n)##
https://www.youtube.com/watch?v=APdKFJkmBbM
a=["abc","aabc","bc"];
b=["ab","a"];
c=((((a⚯)#)⍣)#1n)##;
// join with space, split, find frequency get freq column, then check if same ##
b⚯n.
// could get all operators to work after .? as member function computed logic?
b⚯n.#
- is parsing.
-could do on the member expression part.
b⚯n.#
Call Expression arguments here on parent.
ExpressionStatement in on FROMTO
1..n.#
zoperatordetected
and if binary or suffix?
1..n.#.).##.@.∑
1..n.#.).##.@.∑.➕
1..n.#.).##.@.∑.➕(5)
//1..n.#.).##.@.∑.➕(5)
n=10;
1..n.#.).##.∑.➕(5)
// works
n=10;
1..n.+(454)
1..n.+
n=10;
1..n.+
1..n.+(3,4)
1..n.+(3,4)
1..n.+(3,4)
n=10;
1..n.+(3,4)
n=10;
1..n.+
n=10;
1..n.+[3,4,5]
//becomes matrix get
n=10;
1..n[0]
n=10;
1..n.-;
n=10;
1..n.*;
//did not work
n=10;
1..n.^(4);
n=10;
1..n.~;
[3,4].∑
[3,4].∏
[3,4].* does not work in deference to .* operator
[3,4].&
//instead of *
[3,4].||
[3,4].&&
[3,4].~
[3,4].! // did not work
// for not there is no character yet.
[3,4].*NOT
[3,4].#
[3,4].%%
[0,4].||
[0,4].&&
[1,4].&&
(GTE(1..10.pieces(2,SELF,true)))
[1,4].<=
[1,4].>=
[1,4].%(2)
[1,4]!
1..10.!=
1..10.==
1..10.<=
1..10.>=
[1.01,1.00001].!==
[1.00000002,1.00000001].!==
[0,0,false,false].@
⊥[0,0,false,false]
-becomes MATRIXGET. how does that function work? Seems to be a notation to access values.
a=1..10;
⅟a
a.-
a=1..10;
a[1,2,3]
// to access 1 2 and 3rd items
a=1..10;
a [1,5,2]
a=MS(3)
a [[1,1],2]
a=MS(3)
a [2,3,1]
a=MS(3)
a.∏
a=1..10;
a⁂(3)≡SUM
a=1..10;
a=1..100;
a.$(➕)
a=1..10;
a.*(➕)
1➗3
24﹪4
1..3..30x.) ~
a=1..10;
(a..4)
a=1..10;
(a..10)
a=1..10;
(a..10..((2..20)<>x))
(a..10..((2..20)<>x))≡SUM
a=MS(4)
a~ ⋮ SUM
a=MS(4);
a.∑;
SUM(a)
a.*✖
(4).*✖(45);
(4).*✖;
1..4.✖;
MS(4) ≡ ∑
MS(4) ≡ ✖
MS(4)≡≥
// does not work
MS(4)≡(﹪,3)
a=1..10;
a=1..10;
a.$(➕)
(1..10)➕3
//works now
// this needs to be UNITSADD why did it do SUM here?
(1..10).➕
➕(-1..10)
(1..5)!
(1..5).⁜(4)
// make this work
(1..5).⁜(4)
(1..10).⁜(1..5)
(1..10).﹪(1..3)
(1..10).parts(3,SUM)
(1..10).parts(3,SUM,true)
(1..10).※(3)
[
(1..10).※, // chunks
(1..10).⁜, // parts
(1..10).⁂ // pieces
]
(1..10).※(3) // chunks
(1..10). ⁜ (3) // parts
(1..10). ⁂ (3) // pieces
MS(30). ⁜ (3) .🐾 // print
1..10. ⊫
⊫(1,2,3)
a=1..10;
b=34;
⊫(a,b)
⊫[a,b]
v:=u+a*t;
v#;
v(3,4,5..50)
x1:=u➕a✖t;
x1(3m2,4cm,(5..10)<>mi)
a=%g;
a✖45m
a=%g;
a✖(1..4)<>m
y=(x=>SUM(x));
1..100.*y;
∑(1..10..100x)
(10+12i )✖ 34
(10+12i )✖ 34m3
a=1..13.);
a.pick(Ⓟa)
a=1..13.);
a.pick(Ⓟ)
a=-10..13.);
a.pick([SIN,COS])
[a.pick(SIN,COS)]
a=-10..13.);
a.pick(ISPRIME)
1..100.findv("x>3"!)
1..100.⒱("x>3"!)
1..100.⒠("x>3"!)
1..100.⒤("x>3"!)
1..100.pick("x>3"!)
1..100.⛏("x>3"!)
1..100.⛏("x>3"!)
1..1000.⛏(Ⓟ)
"test"⪡("e")
// why does
1..1000.⛏(Ⓟ) need a . and not "test"⪡("e") split?
..50.).⛏(Ⓟ)
(35000000!P!40n)⁋
a=(35000000!P!40n)⁋;
a#;
((1000n!)⁋)#
1m3 ➕34cm3
1m³ ➕34cm³
(34cm³)³
x=[-2,-1,0;-1,1,3;-1,2,4];
((x⍌)⒱(ⓝ))#
1.3%%5✖3
deg360by10⒠(SIN@ⓝ)
1degreeofarc<>°
-done
why is rad2piby4.$() not working?
rad2piby4.$()
//had to be
(rad2piby4).$(SIN)
rad2piby4 .$(SIN)
-worked. see what is going on.
rad2piby.$(SIN)
-issues.
radpiby4.$(SIN)
-some issue at piby4 etc.
radpipiby4.$(SIN) had issues
raddegby4.$$(SIN)
also had issues.
rad2piby4.$(SIN)
-works
rad2piby4.$$(SIN)
rad2piby4.$(SIN)
ctrl+. to close paranthesis
ShowDataHint
-make it show help message better for z3 command buttons?
-set selection to Shift+Home action
-and () or closest ) or matching ) etc.
-CodeMirror.commands.goLineStartSmart(cm)
1..100.SIN
a=(1..100).SIN
a=(a?b:c)
[1..100.*SIN]~
x=[[[[((((((([[[([1,2,3,4])]]])))))))]]]]
// Ctrl+. at 13 () including a. With space it is better.
a=-10..13
a.pick(ISPRIME)
CTRL+. for ()
CTRL+, for []
CTRL+; for {}
ISDIVISIBLEBY(24,4)
ISDIVISIBLEBY(23,4)
ISDIVISIBLEBY(1..24,4)
ISFACTOROF(4,34)
ISFACTOROF(4,44)
ISDIVISIBLEBY(4..44,1..5)
// Is divisible or not
// Is factor or not.
(4..44) ∣ (1..5); // ISDIVISIBLEBY
(4..44) ∤ (1..5); // ISNOTDIVISIBLEBY
(4..44) ⧵ (1..5); // ISFACTOROF
(4..44) ⧷ (1..5); // ISNOTFACTOROF
FACTORS(60)
FACTORS(60,true)
498960⋲//true
498960⋲true
(1..60)⋲
⋲(1..60)
(1..60)⋲true
5⧵ 455
sin(13rad)
sin(..123)
SIN(13deg)
cos(34..44)
round(34..44..100x)
// round
≈(34..44..100x)
(1..2..10x) ≈
a=34;
a ➕ 34;
a:=π✖r∆2;
a(34mi)
b=45;
a=34;
a➕b
AOC:=π✖r∆2;
a=(1..50)<>m;
AOC(a)~
// shift+space on - gives a wbar char. check why.
x="0034";
kp:=x#(3..0..-1)- x#(0..3);
kp(x)
x=6174;
k=(x⁋);
kp:=(k)-(k⤽);
_y=k;
1..7@(_y=kp(_y));
_y
x=6174;
k=((x⁋)#);
kp:=(k#)⋰-(k#)desc;
_y=k;
1..7@(_y=kp(_y));
_y
shift+space on desc gets entire line as variable or current token
if(SomeToken.type=="variable") type=="error" then parse last token at the cursor maybe
x=6174;
x=1744;
k=((x⁋)#).sort();
kp:=(k⋱)⚯*1 -(k⋰)⚯;
_y=k;
1..7@(()=>_y=kp(_y));
_y
x=6174;
x=1744;
k=((x⁋)#).sort();
kp:=(k⋱)⚯*1 -(k⋰)⚯;
_y=k;
(1..7)@(function(i){⊫(i,_y);_y=kp(_y);⊫("AFTER",_y);});
_y
x=6174;
x=1744;
k=((x⁋)#).sort();
kp:=((k⋱)⚯*1 -(k⋰)⚯);
_y=k;
(1..7)@(
function(i)
{
⊫(i,_y);
_y=((kp(_y)⁋)#);
⊫("AFTER",_y);
}
);
_y
x=6174;
x=1744;
1000..1300@kc;
function kc(x)
{
k=((x⁋)#).sort();
kp:=((k⋱)⚯*1 -(k⋰)⚯);
_y=k;
(1..7)@(
function(i)
{
//⊫(i,_y);
_y=((kp(_y)⁋)#);
⊫("AFTER",i,_y);
}
);
_y
}
1000..1300@kc;
function kc(x)
{
k=((x⁋)#).sort();
kp:=((k⋱)⚯*1 -(k⋰)⚯);
_y=k;
var r=-1;
(1..7)@(
function(i)
{
var t=kp(_y)
if(t==6174)
{
r=i;
}
_y=((t⁋)#);
//⊫("AFTER",i,_y);
}
);
return([x,r,_y])
}
// kaprekar constant
1000..1300@kc;
function kc(x)
{
k=((x⁋)#).sort();
kp:=((k⋱)⚯*1 -(k⋰)⚯);
_y=k;
var r=-1;
var rs=[];
(1..7)@(
function(i)
{
var t=kp(_y)
if(t==6174)
{
r=i;
}
else
{
rs.push(t)
}
_y=((t⁋)#);
//⊫("AFTER",i,_y);
}
);
⊫([x,r,_y,rs])
return([x,r,_y,rs])
}
// kaprekar constant works
1001..1010@kc;
function kc(x)
{
k=((x⁋)#).sort();
kp:=((k⋱)⚯*1 -(k⋰)⚯);
_y=k;
var r=-1;
var rt=-1;
var rs=[];
try
{
(1..7)@(
function(i)
{
var t=kp(_y)
if(t==6174 && r==-1)
{
r=i;
rt=t;
rs.push(t);
throw("EXIT")
}
else
{
rs.push(t)
}
_y=((t⁋)#);
//⊫("AFTER",i,_y);
}
);
}
catch(err)
{
}
⊫([x,r,rt,rs])
return([x,r,_y,rs])
}
on zprod, colored status text does not seem to restore back to normal.
a=rad2piby4;
∑(a@("SIN(x)"!))
FACTORS(60)
// see why it shows only few. what about 12 etc?
PROPERDIVISORS(60)
(1..60)⧶ // PROPERDIVISORS
60 ÷ DIVISORS(60) // did not work
60 ➗ DIVISORS(60)
((1..100)@⧶)≡COUNT
a=1m;
b=10mm;
(a✖b)<>mm2
"test"⫽2
// how to do slice 3, 4 etc.
("test"#)⫽2
a=("test"#);
a⫽(1..2)
a=1..100;
a⫽(1..2)
// did not work. make it on a function with suitable adjustments etc.
- //array params?
- comment character?
- how to make the color change disappear after command windows goes off.
FACTORS
-did not appear in menucategory of ZOPERATORS specified.
1..100.⫽(3,5)
(1..100)⫽(3,5)
// works now
(1..100)⫽([3,5])
// does not work
(1..100)⫽(3,5)
"This is a test"#3..5
(1..100)#3..5
//(1..100)#[3..5] could be a slice, but in array that is accessor with index.
(1..10)#3..50
// how to make this work?
(1..10) ⁜ (4)
(1..10) ⁜ (4,SUM)
(1..100)⫽([3,5],1..4)
// make it work with proper slice function.
(1..100)⫽(3..5,4..6)
(1..100)⫽(3,2..5,true)
(1..100)⫽(3,2..5,true) // third parameter true gives count option for second parameter.
(1..100)⫽(3,2n) // endorcount if n type, gives count.
(1..100)⫽(3,2..5)
(1..100)⫽(3,10)
(#a-z)⫽(3..4,10n)
(1..20..3)⫽(3..4)
a=1..10;
(a) ⁂ 3
((1..10)※(3)).$(SIN)
1..199.※(3)
1..199.※(3,SUM)
1..100. ⫽(2,20n)
DERIVATIVE("x^2","x")
∂"x^2"
"x^2"∂,"x"
"x^2"∂"y"
"x"∫"x^2"
"x^2"∂,"x"
(-10..10)∓;
[-2,-4,-5,4,0,6,55]∓
a=1..10;
b=2..3;
[
a⊂b, // SUBSET
a⊃b, // SUPERSET
a⊄b, // NOTASUBSETOF // for some reason this does not work. need to figure out why.
a⊅b, // NOTASUPERSETOF
a⊆b, // SUBSETOREQUALTO
a⊇b, // SUPERSETOREQUALTO
a⊊b, // SUBSETBUTNOTEQUALTO
a⊋b, // SUPERSETBUTNOTEQUALTO
a⊈b, // NOTSUBSETANDNOTEQUALTO
a⊉b // NOTSUPERSETANDNOTEQUALTO
]
a=5;
b=10;
f=a ∝ b;
f(20)
a=5;
b=10;
f=a ∝ b;
f(1..20)
a=5;
b=10;
c=34;
f1=a ∝ b;
f2=c ∝ b;
f2(f1(10))
a=12..23;
㏒a+㏒103
a=12..23;
㏒4..56
㏒456
a=12..23;
2㏒(4..56)
a=12..23;
100㏒10
a=12..23;
100㏒EXP()
a=12..23;
𝑒³
𝑒(a)
a=12..23;
𝑒³;
𝑒^34
//𝑒²³ did not work. undefined is there.
(𝑒²)³
//works
a=SIN∘COS;
a(45deg)
a=SIN∘COS∘COS;
a(45deg)
a=1..100@SIN;
[a,a]†;
a†; // output only
a=12..23;
(㏒4..56)†;
x=1..100;
(㏒x)†
a↦b
a ↦ b
(a,b)↦{b}
(a,b)↦{b;c;}
(a,b)↦(b,c)
(a,b)↦{b,c}
// handled by replacing before interpreter itself.
it is treated as an object on the right.
causes issues
(a,b) ↦ {b;c}
(b ↦ SIN(b))(34)
("SIN"!) (45)
this.expectorinsert(',',',',true) //z3.
1..100.).*SIN.) †
function a(b=3)
{
return(b^3)
}
a()
a=(b=4)=>b^4;
a()
zmiddlezpanel height 100% important
zstatuszpanel bottom 9px
a=100;
b=200;
a#-3
arrayfying an integer with -3 etc.
a++-3 works. now how can we make this idea work.
with suffix operators etc?
for operator sequences?
try
x=2999;
k=((x⁋)#).sort();
kp:=((k⋱)⚯*1 -(k⋰)⚯);
how should we parse:
k⋱⚯⚯⚯
last one seems lost
k⋱⚯#+b
esprima.ListOperatorPrecedence()
Object.keys(h.z3.z3operatorPrecedence).length
// 2 places with z3operatorPrecedence
a↧∑↥
a~#
a~+g
a=1..4;
g=34;
a~+g
why does
a~~~~~ not work?
x⁋#
-did not retain #
x#⁋⁋⁋⁋ // TOSTRING etc. repeated in BinaryExpression
x### // did not parse after first #
x.#.⁋.⁋.⁋.⁋
// is a good way to do it.
x.∑.↧.↥.^(2)
// is a good way to do it.
x.∑.↧.↥
x=1..10;
x.∑.↧.↥.^(2)
// works
x=1..10;
x.#.∑.↧.↥.^(2)
1..100.∑.√ // had issues
1..100.∑.√(3)
1..100.∑.√
1..100.∑.√(2)
//ROOTNTH(5050,2)
(1..100.∑)√
// sqrt of summation.
x.⁋.#.sort();
//looks ok
x=1999;
k=x.⁋.#.sort();
kp:=k.⋱.⚯*1 -k.⋰.⚯;
// not certain
x=1999;
k=(x.⁋).⪡.⋰;
kp:=k.⋱.⚯*1 -k.⚯;
a=1..10;
a.↧.∑.↥
t=2999;
t.⁋.⪡;
t=2999;
t.⁋.⪡.🐾;
n=[1,2,3,1];
∏((n⍣)#1n)>1
((1m ➕ (34n)<>(cm) )⁶)⁸
2m3∆53mm
∫[sin(x),x]
// didn not work
// need to see if the behavior matches what we expect.
MATRIXIDENTITY(-3,[1,2,3])
MATRIXIDENTITY(-3,[1,2,3])
// why is it starting from 2 and 3?
MATRIXIDENTITY(3,[1,2,3],0,[0,1,2])
MATRIXIDENTITY(3,[1,2,3],0,[0,1,2,3,4])
etc.
IM(-3,[1,2,3])
IM(3,[1,2,3],0..3)
IM(5,1..10,[1,-1])
IM(5,1..10,0,[1,-1])
IM(-5,1..100)
IM(5,1..10,2)
IM(-5)
IM(-5..5)
|-3|
IM(-5)
IM(-5,1..80)
IM(-5,1..80)~
IM(-5,1..80,0,[2])
IM(-20,1..15,0,1..5) // nice pattern
IM(-20,1..20,0,1..12..2)
IM(5,undefined,0,1..3)
IM(50,undefined,0,(i,j)=>(i^2+j^2)<25)
IM(10,undefined,0,(i,j)=>SQRT((i)^2+(j)^2)<5)
IM(10,undefined,0,(i,j)=>SQRT((i-5)^2+(j-5)^2)<5)
IM(50,undefined,0,(i,j)=>SQRT((i-25)^2+(j-25)^2)<15)
IM(50,undefined,0,(i,j)=>SQRT((i-25)^2+(j-25)^2)<25)
IM(50,undefined,"XXX",(i,j)=>SQRT((i-25)^2+(j-25)^2)<25)
IM(50,undefined,"abc"#,(i,j)=>SQRT((i-25)^2+(j-25)^2)<25)
IM( 5,1,0,33)
IM(-5,1,0,33)
IM(-5,1,0,33)
IM(5,1,0,SIN)
IM(90,1,0,COS)
IM(5,1,0,SUM)
IM(5,SUM,0,1)
IM(5,1,0,HYPOTENUSE)
IM(5,1,HYPOTENUSE,0)
IM(5,POWER,0,HYPOTENUSE)
IM(5,POWER,0,CUBED)
IM(5,POWER,[1,2],CUBED)
IM(50,#a-z,"abc"#,(i,j)=>SQRT((i-25)^2+(j-25)^2)<25)
#0-9 going to time
-see if this need to be fixed.
IM(50,1...1000,"abc"#,(i,j)=>SQRT((i-25)^2+(j-25)^2)<25)
IM(10,3,1,3)
IM(10,3,(i,j)=>{return([i,j])},3)
IM(10,3,(i,j)=>{return([[i,j]])},3)
// upon
[-1,-2,3,-3,0,0,34]
.upon(SIN,COS,0)
// how to avoid location unless needed.
[-1,-2,3,-3,0,0,34]
.upon(SIN,COS,SQRT)
[-1,-2,3,-3,0,0,34]
.upon(POWER,POWER,POWER,"LOCATION")
[-1,-2,3,-3,0,0,34]
.upon(CUBED,SQUARED,POWER,"LOCATION")
[-1,-2,3,-3,0,0,34]
.upon(CUBED,SQUARED,POWER,"LOCATION") // location as one array parameter
[-1,-2,3,-3,0,0,34]
.upon(CUBED,SQUARED,POWER,"IJ") // ij as spread parameters
MS(4)
.upon(POWER,null,null,"IJ")
MS(4).uponij(POWER)
MS(4).uponv(CUBED)
MS(4).uponvij(POWER)
MS(4).uponijv(POWER)
MS(4).uponl(POWER)
MS(4).uponl(SUM)
MS(4).uponvl(SUM)
MS(4).uponvl(SELF)
MS(4).uponvl((a,b,c)=>[a,b,c])
|3,3,3,1..10|.uponij((a,b,c)=>[a,b,c])
|3,3,3,3,1..10|.uponij((a,b,c,d)=>[a,b,c,d])
|3,3,3,3,1..10|.uponij(SELF)
|3,3,3,3,1..10|.uponij(SELFS)
|3,3,3,3,4,1..10|.uponij(SELFS)
-5..5.uponij(SIN,TAN,COS)
-5..5.uponvl(SIN,TAN,COS)
-5..5.uponvij(SIN,TAN,COS)
-5..5.uponvij(SIN)
-5..5.uponv(SIN,TAN,COS)
[
1 2 3 4;
-2, -4, 5, -5
]
.uponvij(SUM,AVG,MEDIAN)
// did not work.
[
1 2 3 4;
-2, -4, 5, -5
]
.uponij(∑,⨱,⨸)
// fixed: ⨸ character reused for median and INTDIV.
[
1 2 3 4;
-2, -4, 5, -5
]
.uponij(⨸,⊛,⨱)
[
1 2 3 4;
-2, -4, 5, -5
]
.uponij(⨸,⊛,⨭)
// had issues.
[
1 ,2, 3 ,4;
-2, -4, 5, -5
]⍦(⨸,⊛,⨭)
[
[
1,
2,
3,
4
],
[
-2,
-4,
5,
-5
]
]⍦🅘(MEDIAN, MODE, STDEV);
[
[
1,
2,
3,
4
],
[
-2,
-4,
5,
-5
]
]⍦🅥(MEDIAN, MODE, STDEV);
[
[
1,
2,
3,
4
],
[
-2,
-4,
5,
-5
]
]⍦🅛(MEDIAN, MODE, STDEV);
[
[
1,
2,
3,
4
],
[
-2,
-4,
5,
-5
]
]⍦🅘(MEDIAN, MODE, STDEV);
▚(3)
3▚[2,4,[3]]
3▚(2,6,[1])
▚3..4
3..5.$(▚)~
MATRIXIDENTITY(n)
//now
∑(1..10) // works correctly
(1..10)∑SIN
▚(3..4)
(3..4)▚(1,3,2)
// IM(FROMTO(3, 4), 1, 2, 3);
(1..10)∑[SIN,COS]
// make it work:
SIN∑(1..10)
(1..10)∑(1..10)
etc
(1..10)∑(1..10)
(1..10)∑(1..10)
(1..10)∑(1..10)
(1..10)∑(3)
(1..10)∑3
10∑3
(1..100)∑3
▚(3,4,5,6)
▚(3,4,5,1)
▚(3,0,4,6)
▚(3,"TEST",0,6)
▚(3,"TEST",0,2)
▚(3,"TEST",2,6..10)
▚(3,"TEST",6..10,2)
// how to allow only pure diagonals, and how to give opposing diagonals?
▚(5,4,6,3)
▚(5,4,6,-3n)
▚(5,4,6,3n)
▚(5,4,6,[-1,1])
▚(5,4,6,-2..2)
▚(15,4,6,-2..2)
▚(15,4,6,-2..2n)
▚(15,4,6,2)
▚(15,4,6,2i)
▚(15,4,6,0i)
▚(15,4,6,-1i)
// did not work, because it was translated to
// IM(15, 4, -XUNITSOF(1, "i"), 6);
▚(15,4,6,-1i)
▚(15,4,6,(-2..2)<>i)
// ai generated
function isLeapYear(year) {
// A year is a leap year if it is divisible by 4
// but not divisible by 100, unless it is also divisible by 400
if ((year % 4 === 0 && year % 100 !== 0) || (year % 400 === 0)) {
return true;
}
else {
return false;
}
}
// Example usage:
const year = 2024;
if (isLeapYear(year)) {
console.log(year + " is a leap year.");
}
else {
console.log(year + " is not a leap year.");
}
isLeapYear#;
isLeapYear(2000..2025)
▚(15,4,(-1..1)<>i,6)
-1i
// does not parse well.
// how to make it work?
1cm-(-1m)
1cm➖(➖1m)
// this works well even now.
➖1m
▚(15,4,(-10..10)<>i,6) // generating complex numbers.
▚(15,4,6,(-10..10)<>i)
12-1i
IM({"zmatrix":|4|})
IMX(-3,2,3,1rc)
// rc if any 2 or more dim array.
1r
number as column.
1r or 3c
1c
[1,2] as cell
[-1,2] means all like row.
[0n,2] means all like row.
IM(3,4,9,[1r]) // row for row?
IMX(3,4,9,[1r]) // row for row?
IM(5,4,9,1r..5r..2r)
IM(5,4,9,1r..5r..2r)
IM(5,4,9,1c..5c..2c)
IM(5,4,9,[1c,1r])
IM(5,4,9,1c..3c.concat(1r..3r))
IM(5,4,undefined,[[1,3]])
IM(5,4,3,[[1,3]])
IM(5,4,3,[[1,3],[1,4]])
IM(5,4,3,1..5)
IMX(3,4,9,[1r])
IMX(3,4,9,[1c])
IMX(|4|,2,4,1..3)
IMX(MS(5),1,2,1..3)
XM(|4|,2,4,1..3)
XM(|4|,2,4,1..3)
XM(|4|,2,4,1r)
XM(|4|,2,3,1r)
XM(|4,4,5,1..1000|,2,3,1r)
XM(|5,5,5,1..1000|,ITSELF,3,[0,0,2])
// not matching
XM(|5,5,5,1..1000|,ITSELF,3,[[0,0,2]])
XM(|5,5,5,1..1000|,ITSELF,0,[[0,0,2]])
XM(|5,5,5,1..1000|,ITSELF,0,[i=>i[1]==2])
XM(|5,5,5,1..1000|,ITSELF,0,[ijk=>ijk[2]==2])
XM(|5,5,5,1..1000|,ITSELF,0,[i=>i[0]==2])
XM(|5,5,5,1..1000|,SQUARED,0,[i=>i[0]==2])
XM(|5,5,5,1..1000|,x=>SQUARED(x),0,[i=>i[0]==2])
XM(|5,5,5,1..1000|,(x,loc)=>SQUARED(loc),0,[i=>i[0]==2])
XM(|5,5,5,1..1000|,(x,loc)=>SUM(loc),0,[i=>i[0]==2])
XM(|5,5,5,1..1000|,(x,loc)=>ITSELF(loc),0,[i=>i[0]==2])
⧉(|5,5,5,1..1000|,(x,loc)=>ITSELF(loc),0,[i=>i[0]==2])
⧉(|5,5,5,1..1000|,(x,loc)=>ITSELF(loc),0,[i=>i[0]==2])
var MX;
var MI;
var MXI;
var MIX;
var MN;
var MNX;
var MXN;
var XM;
MI(|5,5,5,1..1000|,ITSELF,0,[i=>i[0]==2])
MX(|5,5,5,1..1000|,ITSELF,0,[i=>i[0]==2])
MIX(|5,5,5,1..1000|,ITSELF,0,[i=>i[0]==2])
MIX(|5,5,5,1..1000|,(loc, x )=>ITSELF(loc,x),0,[i=>i[0]==2])
MIX(|5,5,5,1..1000|,(loc,x)=>ITSELFX(loc,x),0,[i=>i[0]==2])
MIX(|5,5,5,1..1000|,(loc, x )=>ITSELF(x^2),0,[i=>i[0]==2])
MX(|5,5,5,1..1000|,(x )=>ITSELF(x^3),0,[i=>i[0]==2])
// explain this.
XM(|5,5,5,1..1000|,POWER,0,[i=>i[0]==2])
MI(|5,5,5,1..1000|,1,0,[i=>i[0]==2])
MN(|5,5,5,1..1000|,n=>n,0,[i=>i[0]==2])
prompt:
if interest rates go down, how much extra growth can be expected in the market? make a table that shows us how the relationship would be.
(1..200)>3
(1..20)➕3
((1..20)➕3) ∑
aoc:=π✖r∆2;
aoc(12..200)
v:=u➕a✖t;
v#;
v(1(m/s),2(m/s2),(3..5)<>s)
λB([COS,SQUARED]⤽)(1..10)
([DIVIDE,SUM,Length].$fnx("Φ"))+"" (1..10)
// see why it does not work.
([DIVIDE,SUM,Length].$combinators("Φ"))(1..10)
// worked. fnx is for series and parallel in subarrays.
// combinators is what we need to use with a name.
[DIVIDE,SUM,Length].$combinators('Φ') (1..10)
// while editing from templates.
⤽|4||+||4|
a=(EXPAND("(x+y)^4")+"")!;
a(4,5)