// Click the Run button in the toolbar above to start the 故事
//
// =================================================================
//
// The source for the 故事 is provided below
val pg1 = Page(
name = "教程",
body =
<body style="margin:15px;">
一個故事 - 寫作入門.看下編輯器中的代碼 <em>Script Editor</em>, 找找感覺<br/><br/>
<strong>粗體字</strong><br/>
<em>斜體</em><br/>
<p>
另起一段.<br/><br/>
看 <em>代碼</em> 區也就是
<em>Script Editor</em> 看怎麼做一個按鈕,以及當點擊按鈕時如何做一些事情
. 描述一下按鈕的功用, 例如: <br/>
單擊 <em>畫方框</em> 按鈕可畫方框.
</p>
</body>,
code = {
stAddButton ("畫方框") {
clear()
repeat (4) {
forward(100)
right()
}
}
}
)
val pg2 = Page(
name = "",
body =
<body style="margin:15px;">
This page shows you how to display a field to the user, in addition
to displaying a button.<br/>
The idea is that the user fills out the field, and then Clicks the
button. Your program then does its thing based on the input provided
by the user. You write text within the body of the page to describe
the purpose of the field and the button, for example: <br/>
Please enter the size of the square that you want to make in the
<em>Size</em> field below, and then Click the <em>Make Square</em>
button.
</body>,
code = {
stAddField("尺寸", 100)
stAddButton ("Make Square") {
clear()
val size = stFieldValue("尺寸", 100)
repeat (4) {
forward(size)
right()
}
}
}
)
val 故事 = Story(pg1, pg2)
stClear()
stPlayStory(故事)