code wiki / (root) / nx_triple_each_test.nx

nx_triple_each_test.nx source

↩ module page · 15 lines · 436 B

1import "nx_syscalls.nx" 2import "nx_triple_each.nx" 3 4func main() -> nx_int { 5 let buf: *u8 = sys_mmap(80) 6 let arr: *nx_int = buf as *nx_int 7 arr[0] = 2 8 arr[1] = 0 9 arr[2] = -3 10 nx_triple_each(arr, 3) 11 if arr[0] != 6 { return __syscall(93, 1, 0, 0, 0, 0, 0) } 12 if arr[1] != 0 { return __syscall(93, 2, 0, 0, 0, 0, 0) } 13 if arr[2] != -9 { return __syscall(93, 3, 0, 0, 0, 0, 0) } 14 return 0 15}