トップ 履歴 一覧 Farm ソース 検索 ヘルプ PDF RSS ログイン

FlashCardTypebyHSP

*disclaimer
639012

Flash Card Type


一瞬出てくる単語を見て、タイプする。

flashCardType01.hsp(509)

; Flash Card Type
; version 01
; copyleft 2011-05-26 sugiura@nagoya-u.jp

; テキストファイルから、一行一単語、読み込む
; テキストファイルは words.txt というファイル名で、
; 一行一単語ずつにして、同じフォルダーに入れておく。

*start
cls

pos 100, 100
font "MS ゴシック", 48, 17

mes "Now, let's start!"

await 1000

notesel words				; 事前に読み込みバッファ設定
noteload "words.txt"		; テキストファイルの読み込み

gosuu = notemax				; notemaxは、メモリーパッド内の行数。

wordlist = ""
word = ""
point = 0

repeat gosuu				; 行数(語数)分だけ繰り返す。
	noteget word, cnt		; noteget で行単位で読みだす。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 ""
mes "Type the word!"
mes ""
pos 300, 280
button goto "OK", *main
stop


*main
cls

repeat length(R)
;	mes R(cnt)
;	wait 20
	kotae = ""
	typeIn = ""
	monme = str(cnt + 1)
	cls
	
	pos 200, 150
	font "MS ゴシック", 48, 17
	mes monme+": "+wordlist(R(cnt)-1)
	kotae = wordlist(R(cnt)-1)
	wait 120
	cls

	pos 250, 150
	font "MS ゴシック", 44, 17
	objsize 200, 52
	objmode 2, 1
	
	input typeIn
	
	objsel 0
	mes ""
	button gosub "check!", *check
	stop
*here

	font "MS ゴシック", 18, 17
		iti = 30
		repeat point
			pos iti, 30
			color 255,0,0
			mes "★"
			iti = iti + 18
			await 1
		loop
	await 1000
	cls
	await 1
loop

; おわり

wait 80
	pos 200, 100
	font "MS ゴシック", 48, 17
	
mes "おわりますか?"
mes ""
mes ""
	objmode 1
;font "MS ゴシック", 48, 17

button goto "Again!", *start
mes ""
button goto "おわります", *owari
stop


*owari
	cls
	wariai = point*100/gosuu
	font "MS ゴシック", 18, 17
		iti = 30
		repeat point
			pos iti, 30
			color 255,0,0
			mes "★"
			iti = iti + 18
			await 1200
		loop
	pos 200, 100
	color 0,255,0
	font "MS ゴシック", 48, 17
	mes "You got "+point+" points!"
	mes ""
	color 0, 0, 255
	mes "That's "+wariai+" %."
	await 1500
	mes ""
	color 255,255,255
	mes "じゃ、またね。"
	await 1500
end

;------------------- sub ---------------------------

*check

	
	pos 200, 300
	font "MS ゴシック", 48, 17
	
	if kotae == typeIn {
		mes "   Good!"
		mes "You got it!"
		wait 100
		point = point + 1
	}else{
		mes "Oh, no ...."
		mes "That's '"+kotae+"'."
		wait 150
	}
	cls
	
	goto *here


flashCardType01.exe(489)