Difference between revisions of "Z3 Language Tests"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "Here are test cases to try out on ZCubes Code Cubes. Please note that all of the below follow the Z3 Language (Enhanced from Javascript), and hence apart from being simple, it...")
 
Line 4: Line 4:
  
 
a=[1 2; 3]
 
a=[1 2; 3]
 +
 
a=[[1,2],[3]]
 
a=[[1,2],[3]]
 +
 
a=[1 2; 3 4]
 
a=[1 2; 3 4]
 +
 
a=[1 20; 2 3]
 
a=[1 20; 2 3]
 +
 
a=[[1, 20],[2, 3]]
 
a=[[1, 20],[2, 3]]
 +
 
a=[[1, 20],[2, [3 4]]];
 
a=[[1, 20],[2, [3 4]]];
 +
 
a=[[1, 20],[2, [3; 4]]];
 
a=[[1, 20],[2, [3; 4]]];
 +
 
a=[[1, 20],[2, [3; 4;]]]; // worked with after 4 nothing was taken. Is that something to change later? with a null?
 
a=[[1, 20],[2, [3; 4;]]]; // worked with after 4 nothing was taken. Is that something to change later? with a null?
 +
 
a=[1 20; 2;[3,4]; 3]  
 
a=[1 20; 2;[3,4]; 3]  
 +
 
a=[1, (a+b); 2;[3,4]; 3]
 
a=[1, (a+b); 2;[3,4]; 3]
 +
 
a=[1*(a+b); 2;[3,4]; 3]
 
a=[1*(a+b); 2;[3,4]; 3]
 +
 
a=[1*(a+b); 2;[3,4+34]; 3];
 
a=[1*(a+b); 2;[3,4+34]; 3];
 
 
Line 19: Line 30:
 
 
 
|a|;
 
|a|;
 +
 
|10|;
 
|10|;
 +
 
a=|44|
 
a=|44|
 +
 
b=34
 
b=34
 +
 
a=[3,4,2..20]
 
a=[3,4,2..20]
 +
 
a={"car":a}
 
a={"car":a}
 +
 
a=|4x3x3|
 
a=|4x3x3|
 +
 
 
 
a=|3||*||4|
 
a=|3||*||4|
 +
 
a=|5x5|  
 
a=|5x5|  
 +
 
a=|5|
 
a=|5|
 +
 
|10x3|
 
|10x3|
 +
 
a=a|x+3|b;
 
a=a|x+3|b;
 +
 
a=|5||+||5|
 
a=|5||+||5|
 +
 
a=|5||\||5| //for INTDIV
 
a=|5||\||5| //for INTDIV
 +
 
a=|5||/\||5| //for DIVPARTS
 
a=|5||/\||5| //for DIVPARTS
 +
 
a=|5||%||5| //for MATRIXMOD
 
a=|5||%||5| //for MATRIXMOD
+
 
 
a=|3||CHIDIST||4| // should we make this CHIDIST with MOP? Could decide later for MATRIXOPS
 
a=|3||CHIDIST||4| // should we make this CHIDIST with MOP? Could decide later for MATRIXOPS
 +
 
1..100@"x^2"
 
1..100@"x^2"
 +
 
CHIDIST(1..100,2..3) .graph(1,0)
 
CHIDIST(1..100,2..3) .graph(1,0)
 +
 
[1..2,1..4,1..20]@"x^3+y^2+z^3"
 
[1..2,1..4,1..20]@"x^3+y^2+z^3"
 +
 
FOR 20..30 "det(MAGICSQUARE(x))";
 
FOR 20..30 "det(MAGICSQUARE(x))";
 +
 
a=FOR 1..100 SIN;
 
a=FOR 1..100 SIN;
 +
 
a= FOR 20..30 "det(MAGICSQUARE(x))";
 
a= FOR 20..30 "det(MAGICSQUARE(x))";
 +
 +
 
var a=FOR 20..30 "det(MAGICSQUARE(x))";
 
var a=FOR 20..30 "det(MAGICSQUARE(x))";
 +
 
var a=FOR 20..30 "det(MAGICSQUARE(x))",b=FOR 1..100 COS;
 
var a=FOR 20..30 "det(MAGICSQUARE(x))",b=FOR 1..100 COS;
 +
 
radpiby3
 
radpiby3
 +
 
a=SIN(radpiby3)
 
a=SIN(radpiby3)
 +
 
1..100.fillwith(1..10)
 
1..100.fillwith(1..10)
 +
 
(1..100).fillwith(1..10)
 
(1..100).fillwith(1..10)
 +
 
(1..100..10).fillwith(1..10)
 
(1..100..10).fillwith(1..10)
 +
 
1..100.fillwith(10..100).$(CIRCLE)
 
1..100.fillwith(10..100).$(CIRCLE)
 +
 
1..100 .fillwith(10..100).$(CIRCLE)
 
1..100 .fillwith(10..100).$(CIRCLE)
 +
 
1..100..130.fillwith(10..100).$(CIRCLE)
 
1..100..130.fillwith(10..100).$(CIRCLE)
 +
 
SIN@1..100@COS
 
SIN@1..100@COS
 +
 
SIN@1..100
 
SIN@1..100
 +
 
1..100@COS
 
1..100@COS
 +
 
1..100..10@COS
 
1..100..10@COS
 +
 
1..100..10.fillwith(10..100).$(CIRCLE)
 
1..100..10.fillwith(10..100).$(CIRCLE)
 +
 
1..100.23..1023.1 .fillwith(10..1020).$(CIRCLE)   
 
1..100.23..1023.1 .fillwith(10..1020).$(CIRCLE)   
 +
 
1..100..10.fillwith(1..10)
 
1..100..10.fillwith(1..10)
 +
 
FOR 20..30 "det(MAGICSQUARE(x))";
 
FOR 20..30 "det(MAGICSQUARE(x))";
+
 
 
FOR 20..30 "det(MAGICSQUARE(x))";
 
FOR 20..30 "det(MAGICSQUARE(x))";
 +
 
FOR 20..30 "det(MAGICSQUARE(x))";
 
FOR 20..30 "det(MAGICSQUARE(x))";
 +
 
1...100.0343..103.fillwith(1..10)
 
1...100.0343..103.fillwith(1..10)
 +
 
 
 +
 
a=[1  (a+b); 2;[3,4]; 3]
 
a=[1  (a+b); 2;[3,4]; 3]
 +
 
function z()
 
function z()
 
{
 
{
Line 74: Line 130:
 
}
 
}
 
}
 
}
 +
 
function ()
 
function ()
 
{
 
{
Line 81: Line 138:
 
}
 
}
 
}
 
}
 +
 
A=(|3x4|@4.3)@SIN
 
A=(|3x4|@4.3)@SIN
 +
 
|4|.$i([SUM,SIN,COS]);
 
|4|.$i([SUM,SIN,COS]);
 +
 
|4|.$i(SUM,SIN,COS)
 
|4|.$i(SUM,SIN,COS)
 +
 
[["cats1","dogs1"],"birds"]<<<[[2,[COS]],[SIN]]
 
[["cats1","dogs1"],"birds"]<<<[[2,[COS]],[SIN]]
 +
 
[["cats1","dogs1"],"birds"]<<<<[[2,[COS]],[SIN]]
 
[["cats1","dogs1"],"birds"]<<<<[[2,[COS]],[SIN]]
 +
 
[["cats1","dogs1"],"birds"]>>>>[[2,[COS]],[SIN]]
 
[["cats1","dogs1"],"birds"]>>>>[[2,[COS]],[SIN]]
  
 
[#a-z,#A-Z,1..10,4..500]
 
[#a-z,#A-Z,1..10,4..500]
 +
 
a=#a-z
 
a=#a-z
 +
 
a=#1/1/16
 
a=#1/1/16
 +
 
var a=#;
 
var a=#;
 +
 
b=#;
 
b=#;
 +
 
c=#;
 
c=#;
 +
 
d=#;
 
d=#;
 +
 
PMT(#1/1/2011,#2/2012) // worked
 
PMT(#1/1/2011,#2/2012) // worked
 +
 
var a=#a-x;
 
var a=#a-x;
 +
 
b=#1/1/2011;
 
b=#1/1/2011;
 +
 
a = a < 34 ? 3
 
a = a < 34 ? 3
 +
 
#TABLE3!A3:E6  
 
#TABLE3!A3:E6  
 +
 
a=#TABLE3!A3:E6  
 
a=#TABLE3!A3:E6  
 +
 
a=#A3:E6  
 
a=#A3:E6  
 +
 
a=SIN(#D8:E11,#H11:K12)
 
a=SIN(#D8:E11,#H11:K12)
 +
 
#TABLE3!A3:E6  
 
#TABLE3!A3:E6  
 +
 
a=#TABLE3!A3:E6  
 
a=#TABLE3!A3:E6  
 +
 
a=#A3:E6  
 
a=#A3:E6  
 +
 
#D8:E11  
 
#D8:E11  
 +
 
#TABLE3!A3:E6  
 
#TABLE3!A3:E6  
 +
 
[1,2,undefined,#].$(SIN)
 
[1,2,undefined,#].$(SIN)
 +
 
a=[#1/1/2011,#2/2/2015]  
 
a=[#1/1/2011,#2/2/2015]  
 +
 
[1,2,undefined].$(SIN)  
 
[1,2,undefined].$(SIN)  
 +
 
[1,2,undefined,#].$(SIN)
 
[1,2,undefined,#].$(SIN)
 +
 
v:=u+a*t
 
v:=u+a*t
 +
 
E=m*c^2;
 
E=m*c^2;
 +
 
a=5!;
 
a=5!;
 +
 
a=(a+x)!;
 
a=(a+x)!;
 +
 
a=(a+x)*!34;
 
a=(a+x)*!34;
 +
 
a=(5!)!
 
a=(5!)!
 +
 
a=5!! will not work.
 
a=5!! will not work.
 +
 
a=34!P!3
 
a=34!P!3
 +
 
a=34!C!3
 
a=34!C!3
 +
 
a=34!P!3!C!3
 
a=34!P!3!C!3
 
 
 
var a=2;
 
var a=2;
 +
 
v:=u+a*t;
 
v:=u+a*t;
 +
 
var b=3;
 
var b=3;
 
 
 
var a=2;
 
var a=2;
 +
 
var v:=u+a*t;
 
var v:=u+a*t;
 +
 
var b=3;
 
var b=3;
 +
 
 
 
var a=2;
 
var a=2;
 +
 
var v:=u+a*t;
 
var v:=u+a*t;
 +
 
var b=3;
 
var b=3;
 
 
 
var a=2;
 
var a=2;
 +
 
var v:=u+a*t,d=34;
 
var v:=u+a*t,d=34;
 +
 
var b=3;
 
var b=3;
  
Line 142: Line 247:
 
 
 
# means undefined by itself.
 
# means undefined by itself.
 +
 
ad := a+b
 
ad := a+b
 +
 
1..3**3.$d (SIN)  
 
1..3**3.$d (SIN)  
 +
 
(1..3**3).$d (SIN)  
 
(1..3**3).$d (SIN)  
 
 
 
PRODUCT(n..1..-3)
 
PRODUCT(n..1..-3)
 +
 
a=#,b=#,c=#
 
a=#,b=#,c=#
 +
 
FACTTRIPLE=PRODUCT(n..1..-3)
 
FACTTRIPLE=PRODUCT(n..1..-3)
 +
 
FACTTRIPLE:=PRODUCT(n..1..-3)   
 
FACTTRIPLE:=PRODUCT(n..1..-3)   
 +
 
1..10|x<4|
 
1..10|x<4|
  
 
1..10|x?x<4|
 
1..10|x?x<4|
 +
 
1..10|x?x<4:u|
 
1..10|x?x<4:u|
 +
 
1..10|x?x<4:u|1..10
 
1..10|x?x<4:u|1..10
 +
 
1..10|x?u+x<4:u|1..10
 
1..10|x?u+x<4:u|1..10
+
 
 
 
 
|4||x?x<4:false||34| ;
 
|4||x?x<4:false||34| ;
 +
 
|4||x?x<4||34|;
 
|4||x?x<4||34|;
 +
 
|4||x?x<4||34| ;
 
|4||x?x<4||34| ;
 +
 
|4||x?x<4:34+y+z||34|;
 
|4||x?x<4:34+y+z||34|;
 +
 
|4||x?x<4|;
 
|4||x?x<4|;
 +
 
|4||x<4|;
 
|4||x<4|;
 +
 
|1||x<4||x>10|
 
|1||x<4||x>10|
+
 
 +
 
 
1..10|x<4&&y>9|2..20
 
1..10|x<4&&y>9|2..20
 +
 
a=3!
 
a=3!
 +
 
a=100..|x+y|3
 
a=100..|x+y|3
 +
 
..100
 
..100
 +
 
10..
 
10..
  
 
1..10|x<4|
 
1..10|x<4|
 +
 
1..10|x<4|34  
 
1..10|x<4|34  
 +
 
1..10|x^3&&x^3<3000?x|w
 
1..10|x^3&&x^3<3000?x|w
 +
  
 
0..10@"SIN(x^2,1..10)" .graph()
 
0..10@"SIN(x^2,1..10)" .graph()
 +
 
0..10@("SIN(x^2,1..10)" .graph())
 
0..10@("SIN(x^2,1..10)" .graph())
 +
 
0..10@"SIN(x^2,1..23..10)".graph(30).sin()
 
0..10@"SIN(x^2,1..23..10)".graph(30).sin()
 +
 
0..10@"SIN(x^2,1..23..10)".graph(30).sin()
 
0..10@"SIN(x^2,1..23..10)".graph(30).sin()
 +
 
1..1000..100@["x^2",COS] .graph()   
 
1..1000..100@["x^2",COS] .graph()   
  
 
0..10@"SIN(x^2,1..10)" .graph()
 
0..10@"SIN(x^2,1..10)" .graph()
 +
 
0..10@("SIN(x^2,1..10)" .graph())
 
0..10@("SIN(x^2,1..10)" .graph())
 +
 
0..10@"SIN(x^2,1..23..10)".graph(30).sin()
 
0..10@"SIN(x^2,1..23..10)".graph(30).sin()
 +
 
0..10@"SIN(x^2,1..23..10)".graph(30).sin()
 
0..10@"SIN(x^2,1..23..10)".graph(30).sin()
 
 
 
0..10@"SIN(x^2,1..10)" .graph()
 
0..10@"SIN(x^2,1..10)" .graph()
 +
 
SIN(x^2,1..10)
 
SIN(x^2,1..10)
 +
 
 
 
1..3**3.$d (SIN)  
 
1..3**3.$d (SIN)  
 +
 
(1..3**3).$d (SIN)  
 
(1..3**3).$d (SIN)  
 +
 
 
 
(1..1000..100@["x^2",COS] .$(SIN)) @SIN
 
(1..1000..100@["x^2",COS] .$(SIN)) @SIN
 +
 
0..10@"SIN(x^2)" .graph()
 
0..10@"SIN(x^2)" .graph()
 +
 
0..10@"SIN(x^2)".graph()
 
0..10@"SIN(x^2)".graph()
 +
 
1..10|x<4|34
 
1..10|x<4|34
 +
 
1..10|(x?x<4)|
 
1..10|(x?x<4)|
 +
 
var a=FOR 20..30 "det(MAGICSQUARE(x))", b=FOR 1..100 COS;
 
var a=FOR 20..30 "det(MAGICSQUARE(x))", b=FOR 1..100 COS;
 
 
 +
 
a=[1*(a+b); 2;[3,4+34]; 3]  
 
a=[1*(a+b); 2;[3,4+34]; 3]  
 +
 
|a|
 
|a|
 
|10|
 
|10|
 
 
a=[1*(a+b); 2;[3,4+34]; 3]; |a|; |10|
+
a=[1*(a+b); 2;[3,4+34]; 3]; |a|; |10|
 +
 
PMT(100000,44%,40)
 
PMT(100000,44%,40)
 +
 
a=FOR(PMT, 100000,41% ,1..12)
 
a=FOR(PMT, 100000,41% ,1..12)
 +
 
 
 
pmt12:=PMT(x,y,12);
 
pmt12:=PMT(x,y,12);
 +
 
PMT(1000,26%)
 
PMT(1000,26%)
 +
 
vary...
 
vary...
 
 
 
Θ=3+x;
 
Θ=3+x;
 +
 
Θ(34)
 
Θ(34)
 +
 
അത:=34+അതx;
 
അത:=34+അതx;
 +
 
അത(4)
 
അത(4)
 +
 
 
 
/*Enter Code Here in Z3/Javascript...*/
 
/*Enter Code Here in Z3/Javascript...*/
 +
 
var a=10;
 
var a=10;
 +
 
for(var b=1;b<a;b++)
 
for(var b=1;b<a;b++)
 +
 
{
 
{
 +
 
  console.log(b)
 
  console.log(b)
 +
 
}   
 
}   
 +
 
 
 
/*Enter Code Here in Z3/Javascript...*/
 
/*Enter Code Here in Z3/Javascript...*/
 +
 
function test()
 
function test()
 +
 
{
 
{
 +
 
  var a=25;
 
  var a=25;
 +
 
  c=[]
 
  c=[]
 +
 
  for(var b=1;b<a;b++)
 
  for(var b=1;b<a;b++)
 +
 
  {
 
  {
 +
 
c.push(b)
 
c.push(b)
 +
 
  }   
 
  }   
 +
 
  return(c);
 
  return(c);
 +
 
}
 
}
 +
 
test()
 
test()

Revision as of 15:45, 30 March 2016

Here are test cases to try out on ZCubes Code Cubes. Please note that all of the below follow the Z3 Language (Enhanced from Javascript), and hence apart from being simple, it gives you full programming capability.


a=[1 2; 3]

a=[[1,2],[3]]

a=[1 2; 3 4]

a=[1 20; 2 3]

a=[[1, 20],[2, 3]]

a=[[1, 20],[2, [3 4]]];

a=[[1, 20],[2, [3; 4]]];

a=[[1, 20],[2, [3; 4;]]]; // worked with after 4 nothing was taken. Is that something to change later? with a null?

a=[1 20; 2;[3,4]; 3]

a=[1, (a+b); 2;[3,4]; 3]

a=[1*(a+b); 2;[3,4]; 3]

a=[1*(a+b); 2;[3,4+34]; 3];


|a|;

|10|;

a=|44|

b=34

a=[3,4,2..20]

a={"car":a}

a=|4x3x3|


a=|3||*||4|

a=|5x5|

a=|5|

|10x3|

a=a|x+3|b;

a=|5||+||5|

a=|5||\||5| //for INTDIV

a=|5||/\||5| //for DIVPARTS

a=|5||%||5| //for MATRIXMOD

a=|3||CHIDIST||4| // should we make this CHIDIST with MOP? Could decide later for MATRIXOPS

1..100@"x^2"

CHIDIST(1..100,2..3) .graph(1,0)

[1..2,1..4,1..20]@"x^3+y^2+z^3"

FOR 20..30 "det(MAGICSQUARE(x))";

a=FOR 1..100 SIN;

a= FOR 20..30 "det(MAGICSQUARE(x))";


var a=FOR 20..30 "det(MAGICSQUARE(x))";

var a=FOR 20..30 "det(MAGICSQUARE(x))",b=FOR 1..100 COS;

radpiby3

a=SIN(radpiby3)

1..100.fillwith(1..10)

(1..100).fillwith(1..10)

(1..100..10).fillwith(1..10)

1..100.fillwith(10..100).$(CIRCLE)

1..100 .fillwith(10..100).$(CIRCLE)

1..100..130.fillwith(10..100).$(CIRCLE)

SIN@1..100@COS

SIN@1..100

1..100@COS

1..100..10@COS

1..100..10.fillwith(10..100).$(CIRCLE)

1..100.23..1023.1 .fillwith(10..1020).$(CIRCLE)

1..100..10.fillwith(1..10)

FOR 20..30 "det(MAGICSQUARE(x))";

FOR 20..30 "det(MAGICSQUARE(x))";

FOR 20..30 "det(MAGICSQUARE(x))";

1...100.0343..103.fillwith(1..10)


a=[1 (a+b); 2;[3,4]; 3]

function z() { if(a<3) { return(false); } }

function () { if(a<3) { return(false) } }

A=(|3x4|@4.3)@SIN

|4|.$i([SUM,SIN,COS]);

|4|.$i(SUM,SIN,COS)

[["cats1","dogs1"],"birds"]<<<[[2,[COS]],[SIN]]

[["cats1","dogs1"],"birds"]<<<<[[2,[COS]],[SIN]]

[["cats1","dogs1"],"birds"]>>>>[[2,[COS]],[SIN]]

[#a-z,#A-Z,1..10,4..500]

a=#a-z

a=#1/1/16

var a=#;

b=#;

c=#;

d=#;

PMT(#1/1/2011,#2/2012) // worked

var a=#a-x;

b=#1/1/2011;

a = a < 34 ? 3

#TABLE3!A3:E6

a=#TABLE3!A3:E6

a=#A3:E6

a=SIN(#D8:E11,#H11:K12)

#TABLE3!A3:E6

a=#TABLE3!A3:E6

a=#A3:E6

#D8:E11

#TABLE3!A3:E6

[1,2,undefined,#].$(SIN)

a=[#1/1/2011,#2/2/2015]

[1,2,undefined].$(SIN)

[1,2,undefined,#].$(SIN)

v:=u+a*t

E=m*c^2;

a=5!;

a=(a+x)!;

a=(a+x)*!34;

a=(5!)!

a=5!! will not work.

a=34!P!3

a=34!C!3

a=34!P!3!C!3

var a=2;

v:=u+a*t;

var b=3;

var a=2;

var v:=u+a*t;

var b=3;


var a=2;

var v:=u+a*t;

var b=3;

var a=2;

var v:=u+a*t,d=34;

var b=3;

var a=#a-x,d=#1/1/2011;

# means undefined by itself.

ad := a+b

1..3**3.$d (SIN)

(1..3**3).$d (SIN)

PRODUCT(n..1..-3)

a=#,b=#,c=#

FACTTRIPLE=PRODUCT(n..1..-3)

FACTTRIPLE:=PRODUCT(n..1..-3)

1..10|x<4|

1..10|x?x<4|

1..10|x?x<4:u|

1..10|x?x<4:u|1..10

1..10|x?u+x<4:u|1..10


|4||x?x<4:false||34| ;

|4||x?x<4||34|;

|4||x?x<4||34| ;

|4||x?x<4:34+y+z||34|;

|4||x?x<4|;

|4||x<4|;

|1||x<4||x>10|


1..10|x<4&&y>9|2..20

a=3!

a=100..|x+y|3

..100

10..

1..10|x<4|

1..10|x<4|34

1..10|x^3&&x^3<3000?x|w


0..10@"SIN(x^2,1..10)" .graph()

0..10@("SIN(x^2,1..10)" .graph())

0..10@"SIN(x^2,1..23..10)".graph(30).sin()

0..10@"SIN(x^2,1..23..10)".graph(30).sin()

1..1000..100@["x^2",COS] .graph()

0..10@"SIN(x^2,1..10)" .graph()

0..10@("SIN(x^2,1..10)" .graph())

0..10@"SIN(x^2,1..23..10)".graph(30).sin()

0..10@"SIN(x^2,1..23..10)".graph(30).sin()

0..10@"SIN(x^2,1..10)" .graph()

SIN(x^2,1..10)


1..3**3.$d (SIN)

(1..3**3).$d (SIN)


(1..1000..100@["x^2",COS] .$(SIN)) @SIN

0..10@"SIN(x^2)" .graph()

0..10@"SIN(x^2)".graph()

1..10|x<4|34

1..10|(x?x<4)|

var a=FOR 20..30 "det(MAGICSQUARE(x))", b=FOR 1..100 COS;


a=[1*(a+b); 2;[3,4+34]; 3]

|a| |10|

a=[1*(a+b); 2;[3,4+34]; 3]; |a|; |10|

PMT(100000,44%,40)

a=FOR(PMT, 100000,41% ,1..12)


pmt12:=PMT(x,y,12);

PMT(1000,26%)

vary...

Θ=3+x;

Θ(34)

അത:=34+അതx;

അത(4)


/*Enter Code Here in Z3/Javascript...*/

var a=10;

for(var b=1;b<a;b++)

{

console.log(b)

}


/*Enter Code Here in Z3/Javascript...*/

function test()

{

var a=25;

c=[]

for(var b=1;b<a;b++)

{

c.push(b)

}

return(c);

}

test()