Microsoft Small Basic

Program Listing: SHL348
TextWindow.WriteLine("ランニングゲーム")
hp= 100
run= 0
While hp>1
TextWindow.WriteLine("休む?走る?")
TextWindow.WriteLine("休むときは「休む」とタイプし、")
TextWindow.WriteLine("走るときは「休む」以外をタイプしてください。")
TextWindow.WriteLine("体力を切らさないように!")
If TextWindow.Read()= "休む"Then
TextWindow.WriteLine("休んで体力回復")
hp= hp+30
TextWindow.WriteLine("ただいまのHP "+hp)
Else
TextWindow.WriteLine("走って体力消耗")
hp= hp-50
run= run+1
TextWindow.WriteLine("ただいまのHP "+hp)
EndIf
EndWhile
TextWindow.WriteLine("力尽きた・・・")
TextWindow.WriteLine("ゲームオーバー")
TextWindow.WriteLine("走った回数  " +run)