DJ 的加法遊戲

POWEBE 平台也可以寫小朋友的簡單數學遊戲, 如以下的例子

image

M InitialSteps=0
M ENDTIME = 100
M TERMINATE = if(simStep>10,1,0)

v upper=9999
v lower=100
v eachQuestion=10
v number1 = int(randbetween(lower,upper))
v number2 = int(randbetween(lower,upper))
v answer = number1 + number2
v preAnswer=previous(answer,NONE)
D myAnswer=none
S Result=if(simStep=0,"",if(IfCorrect=1,"You are right...","You are wrong ...Try Again."))

V IfCorrect=if(myAnswer = preAnswer,1,0)
V Score = if(simStep=0,0,previous(score,0) + IfCorrect*eachQuestion)
T table 1 = {"number1","number2","myAnswer","ifCorrect","Result","score"}
M TextInformation = "dj-add1.htm"

要配合以下的 DJ-add1.htm 檔

<h1>D. J. 的加法遊戲</h1>

<font size=+2>上一題正確的答案是: <font color=gray size=+4>[[preAnswer]]</font></font>
<font color=red size=+2>
[[Result]]</font>
<center><u><font color=black size=+2 >       我總共的得分:</font><font color=green size=+4>[[score]]</font> </u></center>
<font size=+2>請回答下一題:</font>
<font color=blue size=+4>
[[number1]] + [[number2]] = ???
</font>

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: