00年度[荒井]情報処理概論
up date:2000.9.23
荒井 良徳[後期の授業一覧に戻る] [TopPageに戻る] [前回の授業のページ に戻る] [次回の授業のページ に進む]
*「3.条件分岐(if)と論理演算及びランダム(randomize; rnd)(10/16)*
○先週の復習
n = InputBox("please input your bone year")
t = 2000 - n
text1.Text = t
3.条件分岐(if)と論理演算及びランダム(randomize; rnd)(10/16)
n = InputBox("please input your bone year")
t = 2000 - n
text1.Text = t
If t < 20 Then
text2.Text = "NG"
Else
text2.Text = "OK"
End If
>=, >, =, <, <= [両端に値/変数を書いて比べる]
and, or [両端に論理式を書いてつなげて比べる]
not [右に論理式を書いて否定する]
a < b
a > 0 and a < 10
a < 0 or a > 10
c = a Mod b
とした場合、a÷bの余りがcに代入される。
Randomize
x = Int( Rnd * 6 ) + 1
Picture3.picture = Picture1.picture