test: 添加 Demo21 项目
This commit is contained in:
parent
7c242d998f
commit
60388f6846
35
playground/Demo/Demo21/Main.snow
Normal file
35
playground/Demo/Demo21/Main.snow
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
module: Main
|
||||||
|
import: os
|
||||||
|
globals:
|
||||||
|
declare sum: int = 123
|
||||||
|
function: main
|
||||||
|
parameter:
|
||||||
|
return_type: int
|
||||||
|
body:
|
||||||
|
declare arr: int[][][][][][][][][][][][][][][][][][][][][][] = [[[[[[[[[[[[[[[[[[[[[[1], [2], [3]]]]]]]]]]]]]]]]]]]]]]
|
||||||
|
loop:
|
||||||
|
init:
|
||||||
|
declare i: int = 0
|
||||||
|
cond:
|
||||||
|
i < 3
|
||||||
|
step:
|
||||||
|
i = i + 1
|
||||||
|
body:
|
||||||
|
arr[0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][i][0] = arr[0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][i][0] + 1
|
||||||
|
end body
|
||||||
|
end loop
|
||||||
|
loop:
|
||||||
|
init:
|
||||||
|
declare i: int = 0
|
||||||
|
cond:
|
||||||
|
i < 3
|
||||||
|
step:
|
||||||
|
i = i + 1
|
||||||
|
body:
|
||||||
|
os.print(arr[0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][0][i][0])
|
||||||
|
end body
|
||||||
|
end loop
|
||||||
|
return 0
|
||||||
|
end body
|
||||||
|
end function
|
||||||
|
end module
|
||||||
11
playground/Demo/Demo21/OS.snow
Normal file
11
playground/Demo/Demo21/OS.snow
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
module: os
|
||||||
|
import: os
|
||||||
|
function: print
|
||||||
|
parameter:
|
||||||
|
declare i1: int
|
||||||
|
return_type: void
|
||||||
|
body:
|
||||||
|
syscall("PRINT",i1)
|
||||||
|
end body
|
||||||
|
end function
|
||||||
|
end module
|
||||||
Loading…
x
Reference in New Issue
Block a user