總之……就是非常,非常蠢的吧【。全局還是非全局變量什麽的也許我自己再去調整
請幫一下我這個廢渣。
//abrogation|n.取消,廢除
//↑大概dict.txt當中是這種感覺
//英翻中測驗
OnWordTestEnCh
{
_file = "dic\dict.txt";//引用文档
FOPEN(_file, "r");
//大概這裡就是不會寫而導致死循環的地方
//本來是想把讀取的內容寫為_dictionary的文本,然後存入名為_content的陣列,再隨機從裏面抽取元素
_right = _content //抽出正解和不正解
_wrong1 = _content
_wrong2 = _content
_wrong3 = _content
while _wrong1 == _right
{_wrong1 = _content}
while _wrong2 == _wrong1 || _wrong2 == _right
{_wrong2 = _content}
while _wrong3 == _wrong1 || _wrong3 == _wrong2 || _wrong3 == _right
{_wrong3 = _content}
_right = SPLIT(_right,'|')//分割正解
_question = _right[0]
answer = _right[1]
_wrong1 = SPLIT(_wrong1,'|')//分割不正解,只留下需要的部份
_wrong2 = SPLIT(_wrong2,'|')
_wrong3 = SPLIT(_wrong3,'|')
_wrong1 = _wrong1[1]
_wrong2 = _wrong2[1]
_wrong3 = _wrong3[1]
_optionpool = "answer,_wrong1,_wrong2,_wrong3" //收入答案池
_a = "\![*]A.\q[_optionpool,WORDCHOOSE]" //生成选项abcd,这样每次正解所在的位置都不同
_b = "\![*]B.\q[_optionpool,WORDCHOOSE]"
_c = "\![*]C.\q[_optionpool,WORDCHOOSE]"
_d = "\![*]D.\q[_optionpool,WORDCHOOSE]"
while _a == _b
{_b = "\![*]B.\q[_optionpool,WORDCHOOSE]"}
while _a == _c || _b == _c
{_c = "\![*]C.\q[_optionpool,WORDCHOOSE]"}
while _a == _d || _b == _d || _c == _d
{_d = "\![*]D.\q[_optionpool,WORDCHOOSE]"}
//最後輸出
//時間計算reset
timer = 4
"\*\_q單詞%_question的正確意思是\n\n/
%(_a) %(_b) %(_c) %(_d)\_q\n\n"
}
OnSecondChange
{
if timer >0
{timer --}
}
OnChoiceSelectEx
{
if reference1 == "WORDCHOOSE"
{
if reference0 == answer//正解
{
correct ++
questionaire ++
if timer > 0
{timebonus ++}
""
--
"嗯嗯,好像是那樣。"
}
else//不正解
{
questionaire ++
"\0"
--
"欸……是這樣的嗎……"
}
--
"\![*]\q[下一題,OnWordTestEnCh]\![*]\q[到此為止,ResultCount]"
}
elseif reference1 == "ResultCount"
{
//獲取出題數和答對數
memoryout = memoryout + correct + timebonus
"\0\s[3]這次的正確率是……%correct/%questionaire。\n\_q(得到獎勵%(correct+timebonus)點)\n\n\![*]\q[完畢,OnWordTestEnd]\_q"
}
else
{EVAL("%(reference1)")}
}
[[i] 本帖最後由 Accveronica 於 2013-3-7 01:18 編輯 [/i]]