-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[readonly] Add more execution tests (#359)
- Loading branch information
Showing
128 changed files
with
1,793 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//@execute = false | ||
def nn() -> array<byte> { | ||
return ['0']; | ||
} | ||
def main() -> bool { | ||
return nn() == nn(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//@execute = false | ||
def nn() -> array<int> { | ||
return [0]; | ||
} | ||
def main() -> bool { | ||
return nn() == nn(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//@execute 0 = 1 | ||
var array: array<int> = Array<int>.new(1); | ||
def main(a: int) -> int { | ||
return array.length; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//@execute 0 = 1 | ||
var x: array<int> = [0]; | ||
def main(a: int) -> int { | ||
return x.length; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//@execute 0 = 3 | ||
var x: array<int> = [0, 1, 2]; | ||
def main(a: int) -> int { | ||
return x.length; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//@execute 0 = 3 | ||
var x: Array<int> = [0, 1, 2]; | ||
def main(a: int) -> int { | ||
return array<int>.length(x); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//@execute 0 = 3 | ||
var x: array<int> = [0, 1, 2]; | ||
def main(a: int) -> int { | ||
var f = array<int>.length; | ||
return f(x); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//@execute 0 = 3 | ||
var x: array<int> = [0, 1, 2]; | ||
def main(a: int) -> int { | ||
var f = array<int>.length; | ||
return do(f); | ||
} | ||
def do(f: array<int> -> int) -> int { | ||
return f(x); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//@execute 0 = 2 | ||
var x: array<int> = Array<int>.new(1); | ||
def main(a: int) -> int { | ||
return x.length * 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//@execute 0='0'; 1='1'; 2=!BoundsCheckException; 3=!BoundsCheckException; 4=!BoundsCheckException; 5='0'; 6='x'; 7='y'; 8='z' | ||
var a: array<(byte, byte)> = [('0', '1')]; | ||
var b: array<(byte, byte)>; | ||
def main(arg: int) -> byte { | ||
if (arg == 0) return a[0].0; | ||
if (arg == 1) return a[0].1; | ||
if (arg == 2) return a[1].0; | ||
if (arg == 3) return a[1].1; | ||
if (arg == 4) return a[2].0; | ||
if (arg == 5) { b = a; return b[0].0; } | ||
if (arg == 6) { b = [('x', 'y')]; return b[0].0; } | ||
if (arg == 7) { | ||
var b = Array<(byte, byte)>.new(2); | ||
b[0] = ('x', 'y'); | ||
return b[0].1; | ||
} | ||
return 'z'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//@execute 0='0'; 1='1'; 2='2'; 3='3'; 4=!BoundsCheckException; 5='0'; 6='x'; 7='y'; 8='z' | ||
var a: array<(byte, byte)> = [('0', '1'), ('2', '3')]; | ||
var b: array<(byte, byte)>; | ||
def main(arg: int) -> byte { | ||
if (arg == 0) return a[0].0; | ||
if (arg == 1) return a[0].1; | ||
if (arg == 2) return a[1].0; | ||
if (arg == 3) return a[1].1; | ||
if (arg == 4) return a[2].0; | ||
if (arg == 5) { b = a; return b[0].0; } | ||
if (arg == 6) { b = [('x', 'y')]; return b[0].0; } | ||
if (arg == 7) { | ||
var b = Array<(byte, byte)>.new(2); | ||
b[0] = ('x', 'y'); | ||
return b[0].1; | ||
} | ||
return 'z'; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//@execute 0='0'; 1='1'; 2='2'; 3='3'; 4=!BoundsCheckException; 5='0'; 6='x'; 7='y'; 8='z' | ||
var a: array<(byte, int, byte)> = [('0', 48, '1'), ('2', 49, '3')]; | ||
var b: array<(byte, int, byte)>; | ||
def main(arg: int) -> byte { | ||
if (arg == 0) return a[0].0; | ||
if (arg == 1) return a[0].2; | ||
if (arg == 2) return a[1].0; | ||
if (arg == 3) return a[1].2; | ||
if (arg == 4) return a[2].0; | ||
if (arg == 5) { b = a; return b[0].0; } | ||
if (arg == 6) { b = [('x', 33, 'y')]; return b[0].0; } | ||
if (arg == 7) { | ||
var b = Array<(byte, int, byte)>.new(2); | ||
b[0] = ('x', 34, 'y'); | ||
return b[0].2; | ||
} | ||
return 'z'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//@execute 0='0'; 1='1'; 2='2'; 3='3'; 4=!BoundsCheckException; 5='0'; 6='x'; 7='y'; 8='z' | ||
class C { | ||
def i: int; | ||
new(i) { } | ||
} | ||
var a: array<(byte, C)> = [('0', C.new('1')), ('2', C.new('3'))]; | ||
var b: array<(byte, C)>; | ||
def main(arg: int) -> byte { | ||
if (arg == 0) return a[0].0; | ||
if (arg == 1) return byte.view(a[0].1.i); | ||
if (arg == 2) return a[1].0; | ||
if (arg == 3) return byte.view(a[1].1.i); | ||
if (arg == 4) return a[2].0; | ||
if (arg == 5) { b = a; return b[0].0; } | ||
if (arg == 6) { b = [('x', C.new('y'))]; return b[0].0; } | ||
if (arg == 7) { | ||
var b = Array<(byte, C)>.new(2); | ||
b[0] = ('x', C.new('y')); | ||
return byte.view(b[0].1.i); | ||
} | ||
return 'z'; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//@execute 0='0'; 1='1'; 2='2'; 3='3'; 4=!BoundsCheckException; 5='0'; 6='x'; 7='y'; 8='z' | ||
class Cb { | ||
def c: byte; | ||
new(c) { } | ||
} | ||
class Ca { | ||
def i: int; | ||
new(i) { } | ||
} | ||
var a: array<(Cb, Ca)> = [(Cb.new('0'), Ca.new('1')), (Cb.new('2'), Ca.new('3'))]; | ||
var b: array<(Cb, Ca)>; | ||
def main(arg: int) -> byte { | ||
if (arg == 0) return a[0].0.c; | ||
if (arg == 1) return byte.view(a[0].1.i); | ||
if (arg == 2) return a[1].0.c; | ||
if (arg == 3) return byte.view(a[1].1.i); | ||
if (arg == 4) return a[2].0.c; | ||
if (arg == 5) { b = a; return b[0].0.c; } | ||
if (arg == 6) { b = [(Cb.new('x'), Ca.new('y'))]; return b[0].0.c; } | ||
if (arg == 7) { | ||
var b = Array<(Cb, Ca)>.new(2); | ||
b[0] = (Cb.new('x'), Ca.new('y')); | ||
return byte.view(b[0].1.i); | ||
} | ||
return 'z'; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//@execute 0=0; 1=1; 2=2 | ||
def main(arg: int) -> int { | ||
return n(arg).length; | ||
} | ||
def n(l: int) -> array<(int, int)> { | ||
return Array<(int, int)>.new(l); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//@execute 0=0; 1=1; 2=2 | ||
def main(arg: int) -> int { | ||
return n(arg)[0].0; | ||
} | ||
def n(l: int) -> array<(int, int)> { | ||
return [(l, 0)]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//@execute 0=0; 1=1; 2=2 | ||
def main(arg: int) -> int { | ||
return n(arg).length; | ||
} | ||
def n(l: int) -> array<(int, int)> { | ||
var a = Array<(int, int)>.new(l); | ||
return a; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//@execute 0=!NullCheckException | ||
def main(arg: int) -> int { | ||
return n().length; | ||
} | ||
def n() -> array<(int, int)> { | ||
return null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//@execute 0=!NullCheckException; 1=1 | ||
def main(arg: int) -> int { | ||
return n(arg).length; | ||
} | ||
def n(len: int) -> array<(int, int)> { | ||
if (len == 0) return null; | ||
return Array<(int, int)>.new(len); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//@execute 0=0; 1=1; 2=2 | ||
def main(arg: int) -> int { | ||
return n(arg)[1].0; | ||
} | ||
def n(l: int) -> array<(int, int)> { | ||
return [(l, 0), (l, 1)]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//@execute 0=0; 1=1 | ||
def main(arg: int) -> int { | ||
var a: array<(int, int)> = Array<(int, int)>.new(arg); | ||
return a.length; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//@execute 0=!NullCheckException | ||
def main(arg: int) -> int { | ||
var a: array<(int, int)>; | ||
return a.length; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//@execute 0=1; 1=2; 3=!BoundsCheckException | ||
def x: array<(int, void)> = [(1, ()), (2, ())]; | ||
def main(a: int) -> int { | ||
return x[a].0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//@execute 0=1; 1=2; 3=!BoundsCheckException | ||
def x: array<(int, void)> = [(1, ()), (2, ())]; | ||
def main(a: int) -> int { | ||
return (x[a].0, x[a].1).0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//@execute 0=1; 1=2; 3=!BoundsCheckException | ||
component array_tuple17 { | ||
def x: array<(array_tuple17, int, void)> = [(this, 1, ()), (this, 2, ())]; | ||
def main(a: int) -> int { | ||
return (x[a].0, x[a].1, x[a].2).1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//@execute 0=true; 1=true; 2=false | ||
def main(a: int) -> bool { | ||
def array = [((), true, 'b', 88), ((), false, 'c', 87)]; | ||
if (a == 0) return check(array, 0, (), true, 'b', 88); | ||
if (a == 1) return check(array, 1, (), false, 'c', 87); | ||
return false; | ||
} | ||
def check(x: array<(void, bool, byte, int)>, i: int, a: void, b: bool, c: byte, d: int) -> bool { | ||
var t = x[i]; | ||
if (a != t.0) return false; | ||
if (b != t.1) return false; | ||
if (c != t.2) return false; | ||
if (d != t.3) return false; | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
//@execute 0=true | ||
var alpha: array<byte> = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | ||
def main(arg: int) -> bool { | ||
var i = 0; | ||
while (i < alpha.length) { | ||
if (alpha[i] != 65 + i) return false; | ||
i = i + 1; | ||
} | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
//@execute 0=true | ||
var alpha: array<byte> = "abcdefghijklmnopqrstuvwxyz"; | ||
def main(arg: int) -> bool { | ||
var i = 0; | ||
while (i < alpha.length) { | ||
if (alpha[i] != 97 + i) return false; | ||
i = i + 1; | ||
} | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//@execute (0, 1, 2, 3)=-236; (3, 2, 1, 0)=175; (5, 6, 7, 9)=-54 | ||
def x: array<int> = [0x4c, 0x8c, 0x65, 0x8b, 0xed, 0x3c, 0xe8, 0xd1, 0xb5, 0xcf, 0x53, 0x4c, 0x13, 0x8f, 0x79, 0x6d]; | ||
var index: int; | ||
def main(a: int, b: int, c: int, d: int) -> int { | ||
index = 0; | ||
var x = f(a, b, c, d, (a, a, b, b), (c, c, d, d)); | ||
var y = f(a, b, c, d, (b, a, b, a), (d, c, d, c)); | ||
var z = f(a, b, c, d, (c, d, d, c), (a, b, b, a)); | ||
var w = f(a, b, c, d, (d, a, b, c), (c, d, a, b)); | ||
return x - y + z - w; | ||
} | ||
def f(a: int, b: int, c: int, d: int, e: (int, int, int, int), f: (int, int, int, int)) -> int { | ||
return g(d, a, b, c) + g(e.0, e.1, e.2, e.3) + g(f.3, f.0, f.1, f.2); | ||
} | ||
def g(a: int, b: int, c: int, d: int) -> int { | ||
return get(a) - get(b) + get(c) - get(d); | ||
} | ||
def get(i: int) -> int { | ||
return x[(i + index++) & 0xF]; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//@execute (0, 1, 2, 3)=-123; (3, 2, 1, 0)=438; (5, 6, 7, 9)=-356 | ||
def x: array<int> = [0x4c, 0x8c, 0x65, 0x8b, 0xed, 0x3c, 0xe8, 0xd1, 0xb5, 0xcf, 0x53, 0x4c, 0x13, 0x8f, 0x79, 0x6d]; | ||
var index: int; | ||
def main(a: int, b: int, c: int, d: int) -> int { | ||
index = 0; | ||
var x = f(a, b, c, d, (a, a, b, b), (c, c, d, d)); | ||
var y = f(a, b, c, d, (b, a, b, a), (d, c, d, c)); | ||
var z = f(a, b, c, d, (c, d, d, c), (a, b, b, a)); | ||
var w = f(a, b, c, d, (d, a, b, c), (c, d, a, b)); | ||
return x - y + z - w; | ||
} | ||
def f(a: int, b: int, c: int, d: int, e: (int, int, int, int), f: (int, int, int, int)) -> int { | ||
var x = h(d, a, b, c, (e.0, e.1, e.2, e.3), (f.3, f.0, f.1, f.2)); | ||
var y = h(d, a, c, b, (e.0, e.1, e.2, e.3), (d, c, b, a)); | ||
var z = h(d, c, b, c, (f.0, f.1, f.2, f.3), (f.3, f.0, f.1, f.2)); | ||
var w = h(e.0, e.1, e.2, e.3, (a, b, c, d), (f.3, f.0, f.1, f.2)); | ||
return w - x + y - z; | ||
} | ||
def h(a: int, b: int, c: int, d: int, e: (int, int, int, int), f: (int, int, int, int)) -> int { | ||
return g(d, a, b, c) + g(e.0, e.1, e.2, e.3) + g(f.3, f.0, f.1, f.2); | ||
} | ||
def g(a: int, b: int, c: int, d: int) -> int { | ||
return get(a) - get(b) + get(c) - get(d); | ||
} | ||
def get(i: int) -> int { | ||
return x[(i + index++) & 0xF]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//@execute 0=0; 1=1; 2=2; 3=3; 4=4; 5=5; 6=6; 7=7; 8=8; 9=9; 10=10; 11=11; 12=12; 13=13; 14=14; 15=15 | ||
var c: array<int> = [0b0, 0b1, 0b10, 0b11, 0b100, 0b101, 0b110, 0b111, 0b1000, 0b1001, 0b1010, 0b1011, 0b1100, 0b1101, 0b1110, 0b1111]; | ||
def main(a: int) -> int { | ||
return c[a]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//@execute 95=false; 97=true; 98=false | ||
def main(arg: int) -> bool { | ||
var a: array<int> = ['a']; | ||
return a[0] == arg; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//@execute (95, 'a')=false; (97, 'a')=true; (98, 'x')=false | ||
def main(arg: int, b: byte) -> bool { | ||
var a: array<int> = [b]; | ||
return a[0] == arg; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//@execute 0=0; 1=1; 257=4; 65549=18; 1000000000=1789 | ||
def main(a: int) -> int { | ||
var f: array<byte> = [ | ||
byte.view(a), | ||
byte.view(a >> 8), | ||
byte.view(a >> 16), | ||
byte.view(a >> 24) | ||
]; | ||
|
||
return f[0] + f[1] * 3 + f[2] * 5 + f[3] * 7; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//@execute 0=0; 1=1; 257=4; 65549=18; 1000000000=1789 | ||
var f: Array<byte> = Array.new(4); | ||
def main(a: int) -> int { | ||
var f: array<byte> = [ | ||
byte.view(a), | ||
byte.view(a >> 8), | ||
byte.view(a >> 16), | ||
byte.view(a >> 24) | ||
]; | ||
|
||
return f[0] + f[1] * 3 + f[2] * 5 + f[3] * 7; | ||
} |
Oops, something went wrong.