test: 添加 Demo19 项目
This commit is contained in:
parent
82f4ba1a6e
commit
028561fc4f
14
playground/Demo/Demo19/Main.snow
Normal file
14
playground/Demo/Demo19/Main.snow
Normal file
@ -0,0 +1,14 @@
|
||||
module: Main
|
||||
import: os
|
||||
function: main
|
||||
return_type: void
|
||||
body:
|
||||
declare cols: int = 2
|
||||
declare matrix: int[] = [1, 2, 3, 4]
|
||||
|
||||
declare x: int = matrix[cols]
|
||||
|
||||
os.print(x)
|
||||
end body
|
||||
end function
|
||||
end module
|
||||
11
playground/Demo/Demo19/OS.snow
Normal file
11
playground/Demo/Demo19/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