2023-10-23 13:59:55 +00:00
|
|
|
aqua A
|
2023-09-27 12:07:22 +00:00
|
|
|
|
2023-10-25 09:36:42 +00:00
|
|
|
export bugLNG260
|
2023-09-27 12:07:22 +00:00
|
|
|
|
2023-10-25 10:41:09 +00:00
|
|
|
func create(a: i8) -> -> i8:
|
|
|
|
closureArrow = () -> i8:
|
|
|
|
<- a
|
|
|
|
<- closureArrow
|
|
|
|
|
|
|
|
func test() -> i8, i8:
|
|
|
|
arr1 <- create(1)
|
|
|
|
arr2 <- create(2)
|
|
|
|
<- arr1(), arr2()
|
2023-10-24 09:40:23 +00:00
|
|
|
|
2023-10-25 09:36:42 +00:00
|
|
|
func cmp(a: i32, b: i32, pred: i8 -> bool) -> bool:
|
|
|
|
result: ?bool
|
|
|
|
|
|
|
|
if a < b:
|
|
|
|
result <- pred(-1)
|
|
|
|
else:
|
|
|
|
if a == b:
|
|
|
|
result <- pred(0)
|
|
|
|
else:
|
|
|
|
result <- pred(1)
|
|
|
|
|
|
|
|
<- result!
|
|
|
|
|
|
|
|
func gt(a: i32, b: i32) -> bool:
|
|
|
|
pred = (ord: i8) -> bool:
|
|
|
|
<- ord > 0
|
|
|
|
|
|
|
|
<- cmp(a, b, pred)
|
|
|
|
|
|
|
|
func bugLNG260(a: i32, b: i32) -> bool:
|
|
|
|
<- gt(a, b)
|