Kik
2007-09-11 20:58:21
Anyways, I use this little script to study my Spanish questions.. just decided to post it here. Not very much, about 100 lines and is based off of Readln. I haven't posted any script in a while, and this isn't much, but…
BTW, i'm too lazy to make a nice form for it.
BTW, i'm too lazy to make a nice form for it.
program new;
//By KikWit
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
//Type 'end' to finish the script///////////////////////////////
//Type 'skip' to skip to the next question//////////////////////
//Your responses can have capitals, etc.////////////////////////
//The actual answers that you fill in must be lowercase/////////
//I'm just filling in this space so I can't see the answers.////
////////////////////////////////////////////////////////////////
//////////Flashcards////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
const
NumberofQuestions = 10; //number of questions here, max 10 (I guess)
Topic = 'Spanish Questions, translate from English to Spanish'; //What is the topic of the questions? (not neccessary, just used by me)
var
QuestionsArray: array [0..(NumberofQuestions - 1)] of string;
AnswersArray: array [0..(NumberofQuestions - 1)] of string;
RespondsArray: array [0..(NumberofQuestions - 1)] of string;
DisplayAnswer: boolean;
Correct, Wrong, Skipped, i: integer;
procedure DeclareQA;
begin
DisplayAnswer:= True; //True if it should write the correct answer after getting the question wrong
{QUESTIONS} {ANSWERS MUST BE LOWERCASE}
QuestionsArray[0]:= 'Painted Nails'; AnswersArray[0]:= 'unas pintadas';
QuestionsArray[1]:= 'Braids'; AnswersArray[1]:= 'trenzas';
QuestionsArray[2]:= 'Eyelashes'; AnswersArray[2]:= 'pestanas';
QuestionsArray[3]:= 'Curly'; AnswersArray[3]:= 'rizado';
QuestionsArray[4]:= 'Wavy'; AnswersArray[4]:= 'ondulado';
QuestionsArray[5]:= 'Short'; AnswersArray[5]:= 'corto';
QuestionsArray[6]:= 'Eyes'; AnswersArray[6]:= 'ojos';
QuestionsArray[7]:= 'Braces'; AnswersArray[7]:= 'frenillos';
QuestionsArray[8]:= 'Bangs'; AnswersArray[8]:= 'flequillos';
QuestionsArray[9]:= 'Nose'; AnswersArray[9]:= 'nariz';
end;
procedure AskAQuestion;
begin
Correct:= 0;
Wrong:= 0;
Skipped:= 0;
for i:= 0 to (NumberofQuestions - 1) do
begin
RespondsArray[i]:= Readln('Question ' + inttostr(i) +': ' + QuestionsArray[i]);
case LowerCase(RespondsArray[i]) of
{1}'skip':
begin
inc(Skipped);
Writeln('Question ' + inttostr(i) + ': Skipped');
end;
{2}'end':
begin
Writeln('Exiting...');
exit;
end;
{3}AnswersArray[i]:
begin
Writeln('Question ' + inttostr(i) + ': CORRECT! You answered with "' + RespondsArray[i] + '"!');
inc(Correct);
end else
begin
if DisplayAnswer then
begin
Writeln('Question ' + inttostr(i) + ': WRONG! You answered wrong with "' + RespondsArray[i] + '", the correct answer is "' + AnswersArray[i] + '".');
end else Writeln('Question ' + inttostr(i) + ': WRONG!');
inc(Wrong);
end;
end;
end;
end;
procedure Prog;
begin
Writeln('Number of Questions asked: ' + inttostr(i));
Writeln('Number of Questions answered correctly: ' + inttostr(Correct));
Writeln('Number of Questions answered wrong: ' + inttostr(Wrong));
Writeln('Number of Questions skipped: ' + inttostr(Skipped));
end;
begin
DeclareQA;
ClearDebug;
Readln( Topic + ': The Questions are starting!Type end to exit out, and pay attention to the Debug Box!');
Writeln( Topic + ': The Questions are starting!');
Writeln('Type end to exit out, skip to skip the question, and pay attention to the Debug Box!');
AskAQuestion;
Prog;
end.