; Flash Card ; version 01 ; copyleft 2011-05-26 sugiura@nagoya-u.jp ; 2019-06-27 notegetの説明の修正 ; テキストファイルから、一行一単語、読み込む ; テキストファイルは words.txt というファイル名で、 ; 一行一単語ずつにして、同じフォルダーに入れておく。 *start cls pos 100, 100 font "MS ゴシック", 48, 17 mes "では、はじめます。" notesel notename ; 事前に読み込みバッファ(メモリーパッド)の設定(名前は何でもよい) noteload "words.txt" ; テキストファイルの読み込み gosuu = notemax ; notemaxは、メモリーパッド内の行数。 wordlist = "" word = "" repeat gosuu ; 行数(語数)分だけ繰り返す。 noteget word, cnt ; noteget で行単位でメモリーパッドから読みだす。 ; 読み込んだ内容を入れる変数がword ; メモリーパッドの何番を読み込むか指定 ; この場合、cntで読み込むインデックス番号を指定 wordlist(cnt) = word ; ★ 読み込んだ単語を、配列に入れていく。 word = "" await 1 loop randomize repeat length(wordlist) x = rnd(cnt+1) R(cnt) = R(x) R(x) = cnt + 1 await 1 loop cls pos 100, 100 font "MS ゴシック", 48, 17 mes "単語数は、"+gosuu+"語です。" mes "" pos 100, 200 button goto "OK", *main stop *main cls repeat length(R) ; mes R(cnt) ; wait 20 monme = str(cnt + 1) pos 250, 150 font "MS ゴシック", 48, 17 mes monme+": "+wordlist(R(cnt)-1) wait 120 cls await 1 loop ; おわり wait 150 pos 200, 100 font "MS ゴシック", 48, 17 mes "おわりますか?" mes "" mes "" font "MS ゴシック", 48, 17 button goto "Again!", *start mes "" button goto "おわります", *owari stop *owari cls wait 50 pos 200, 100 font "MS ゴシック", 48, 17 mes "じゃ、またね。" wait 150 end