//PNCYvOI
//OeLXg2ǂ݂ŖƉ𓚂𐶐
//萔wo悤ɂ肷
//肪_uȂ悤ɂ
//vOォPo^ł悤ɂ

//`p[g
screen 0,200,200
randomize
dim q
dim a
//N
*reload
	cls
	i=0
	j=0
	exist "wordQ.txt"
	if strsize=-1:dialog "f[^o^",0,"error 0":stop
	exist "wordA.txt"
	if strsize=-1:dialog "f[^o^",0,"error 0":stop
	notesel data
	noteload "wordQ.txt"

*loadQ
	noteget q(i),i
	if q(i) = -1:goto *loadA2
	i++
	goto *loadQ


*loadA2
	noteload "wordA.txt"
*loadA
	noteget a(j),j
	if a(j) = -1:goto *UI
	j++
	goto *loadA


//C^[tF[X
*UI
button"f[^o^", *getWord
button"eXgJn", *test
button"f[^ēǍ", *reload
stop

//p[g
*getWord
	dialog"ł",0,"error 1"
	stop
*test
	test1=0
	test2=0
	cls
	/*
	screen 1,250,250
	i = rnd (i)
	mes ""+q(i)+" "+a(i)+""
	*/
	screen 1,250,250
	test1 =rnd(i)
	if test1 = -1:goto *test
	answer = rnd(4)
	mes ""+q(test1)+""
	pos 50,190
	if answer = 0{
	button "1."+a(test1)+"",*cor
	}
	else{
		test2 = rnd(j)
		if test2=test1:test2++
		button "1."+a(test2)+"",*inc
	}
	
	pos 50,220
		if answer = 1{
	button "2."+a(test1)+"",*cor
	}
	else{
		test2 = rnd(j)
		if test2=test1:test2++
		button "2."+a(test2)+"",*inc
	}
	
	pos 175,190
		if answer = 2{
	button "3."+a(test1)+"",*cor
	}
	else{
		test2 = rnd(j)
		if test2=test1:test2++
		button "3."+a(test2)+"",*inc
	}
	
	pos 175,220
		if answer = 3{
	button "4."+a(test1)+"",*cor
	}
	else{
		test2 = rnd(j)
		if test2=test1:test2++
		button "4."+a(test2)+"",*inc
	}
stop
*cor
	dialog"",0,"error 2"
	goto *test
*inc
	dialog"s",0,"error 3"
	goto *test
