Gem+
一门新的编程语言
示例
文档
▶ Run
编辑器
1
输出
清除输出
示例程序
✕Gem+ 语言参考
✕Print / Output
Print a value to the output console:
gemlog=Hello, World!
gemlog="Hello, {name}!"
Variables & Math
Declare or assign a variable:
gem x = 10 gem name = "Alice" gem x += 5
Conditionals
gemif x > 10 {
gemlog=Big!
gemelse
gemlog=Small.
}
Loops
gemloop 5 {
gemlog="Step {gemindex}"
}
Functions
gemfn sayHello {
gemlog=Hello!
}
gemcall sayHello
UI Creation (New!)
gemui clear gemui text title "Hello UI" gemui input myInp "Placeholder" gemui button btn "Submit" gemui style title "color: #22d3ee;" // Read inputs & bind events gemread varName myInp gemon click btn myFunc
User Input & Confirm
geminput=name "What is your name?" gemconfirm=ready "Are you ready?" gemnativeconfirm=sure "Are you sure?"
Are you sure?
否
是
Enter a value
Cancel
提交
