From 60388f68465208a9f7e43bfa7f05e7726e953a4c Mon Sep 17 00:00:00 2001 From: Luke Date: Sun, 3 Aug 2025 00:16:17 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=B7=BB=E5=8A=A0=20Demo21=20=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- playground/Demo/Demo21/Main.snow | 35 ++++++++++++++++++++++++++++++++ playground/Demo/Demo21/OS.snow | 11 ++++++++++ 2 files changed, 46 insertions(+) create mode 100644 playground/Demo/Demo21/Main.snow create mode 100644 playground/Demo/Demo21/OS.snow diff --git a/playground/Demo/Demo21/Main.snow b/playground/Demo/Demo21/Main.snow new file mode 100644 index 0000000..f3b11ce --- /dev/null +++ b/playground/Demo/Demo21/Main.snow @@ -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 diff --git a/playground/Demo/Demo21/OS.snow b/playground/Demo/Demo21/OS.snow new file mode 100644 index 0000000..6026d43 --- /dev/null +++ b/playground/Demo/Demo21/OS.snow @@ -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 \ No newline at end of file