homework-and-stuffs/school/cpsc362/project/pseudo/kubap.rtf

91 lines
2.1 KiB
Plaintext

{\rtf1\ansi\ansicpg1252\cocoartf2513
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\f0\fs24 \cf0 starting screen:\
get userID();\
get userAge();\
displayUserInfo();\
getUserInputGameMode();\
1.timeMode()\
2.quizMode()\
3.practiceMode()\
4.calculatorMode()\
5.highScore()\
Case1:\
displayTimeMode();\
userInputTimer();\
set time=userInputTimer();\
if (time >0)\
\{\
A = randomA();\
B = randomB();\
answerC = A+B;\
displayA();\
displayB();\
D= randomD();\
if D=== C then randomD();\
else displayD();\
If user click on answerC then add ++ correctCounter;\
else set A=randomA(); set B=randomA(); \
\}\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf0 else save correctCounter to log;\
print \'93 Retry?\'94 or \'93 exit\'94\
if user click retry, get userInputTimer();\
if user click exit, return to main menu;\
case2:\
question=setNumberOfQuestion();\
setArrayASize = question;\
setArrayBSize= question;\
setArrayCsize= question;\
for( i =0; i< question;i++)\
\{\
arrayA[i]= random();\
arrayB[i] = random();\
arrayC[i]=arrayA[i]+arrayB[i]\
\
\}\
for(i=0;i<question;i++)\
\{\
print arrayA[i] \'93 + \'93 print arrayB[i] \'93 = \'93\
arrayD[i]= userInput(); \
if (arrayC[i]= arrayD[i] )\
correct++;\
else\
wrong++; \
\}\
\
display correct and wrong to screen;\
for(i=0;i<question;i++)\
\{\
display arrayA[i]\'93+\'94 ArrayB[i] \'93= \'93 arrayC[i] \'93your Answer\'94 arrayD[i];\
\
\}\
ask user to continue quiz or exit to main screen\
case3:\
\
if (continue = yes)\
\{ \
A= randomNumber();\
B= randomNumber();\
C= A+B;\
display A \'93+ \'93 B \'93=\'93 then get userInput();\
compare to C to userInput();\
get userInputContinue();\
\} \
else \
exit to main menu\
\
case4:\
display calculator\
\
case5:\
DisplayScore();\
\
\
\
}