Files
CMLeonOS/example.bran
2026-01-31 23:36:50 +08:00

46 lines
697 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Branswe代码示例
# 这个文件展示了Branswe编程语言的基本功能
# 示例1简单的Hello World
conshow hello
var(text) hello = Hello, Branswe!
# 示例2变量操作
var() name = LeonOS
var(text) greeting = Hello, name!
conshow greeting
# 示例3条件判断
if hello == hello
then
conshow match
else
conshow no match
end
# 示例4循环
loop 5
conshow count: i
var(text) count = i
conshow count: count
end
# 示例5计算
var(text) result = 10
var(text) num1 = 5
var(text) num2 = 3
rstr result + num1 + num2
conshow result
# 示例6扬声器响声
conbeep
# 示例7睡眠
sleep 1000
# 示例8清屏
concls
# 示例9结束
end