next up previous contents
Next: SWAPを用いた変数内容の入れ替え Up: 配列を用いる Previous: Sample Program 8a   Contents

Sample Program 8b

次の例では、同じく3枚のカードを引き、出たカードが同じ数だったら得点を得られるとした ゲームです。
\begin{code}
100 dim x(3)
110 m=0
115 randomize
120 for i=1 to 3
130 x(i) = i...
...
310 input ''Continue?(y/n)''; a$
320 if a$=''y'' then 120
990 end
\end{code}



Takeyoshi Nagai 2013-10-07