SRL Archive - Other Scripts

My Spanish 'FlashCards'


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.

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.

Bobarkinator

2007-09-11 21:21:18

Man, my Spanish teacher hasn't taught us any of those words yet, maybe I'll fill out my own questions and answers.

teh_lulz

2007-12-11 20:37:26

Pretty fun script :D
Too bad yo soy el gringo lolol

A G E N T

2007-12-11 20:59:42

Where I live, we learn French :o

Lol, at first I thought:

'Bangs'; AnswersArray[8]:=  'flequillos';

Was a verb :o

gamer 5

2007-12-11 21:55:50

Wow!!

Your Spanish Class is easy!!!

Well what can I say, I'm hispanic, by the way we get way harder stuff than that in our spanish classes!!!

P.S.
Creative Idea!!

osmm

2008-01-08 17:09:07

Very very nice. Like said before those aren't words I'm at so I will be editing it deffinatly and probably adding a lot more words =/. Thanks tho.

Jason2gs

2008-01-11 23:01:41

Cool idea :)

Suggestion: Make a database of words and let the script query it on startup. You could make a MySQL DB as well, but that'd be too much work for something that could be done with just a couple of text files. (The text files would be harder to update, though. The DB would be a lot more versatile.)

Sp0rky

2008-01-11 23:06:22


Spanish Questions, translate from English to Spanish: The Questions are starting!
Type end to exit out, skip to skip the question, and pay attention to the Debug Box!
Question 0: WRONG! You answered wrong with "lol", the correct answer is "unas pintadas".
Question 1: WRONG! You answered wrong with "Brains?", the correct answer is "trenzas".
Question 2: WRONG! You answered wrong with "Errr, Lashesdeeye", the correct answer is "pestanas".
Question 3: WRONG! You answered wrong with "Wurly", the correct answer is "rizado".
Question 4: WRONG! You answered wrong with "Shavy", the correct answer is "ondulado".
Question 5: WRONG! You answered wrong with "Tall", the correct answer is "corto".
Question 6: WRONG! You answered wrong with "Pretty green eyes", the correct answer is "ojos".
Question 7: WRONG! You answered wrong with "Falalaaaa", the correct answer is "frenillos".
Question 8: WRONG! You answered wrong with "Bangs", the correct answer is "flequillos".
Question 9: WRONG! You answered wrong with "Nielee", the correct answer is "nariz".
Number of Questions asked: 10
Number of Questions answered correctly: 0
Number of Questions answered wrong: 10
Number of Questions skipped: 0


I fail at Spanish.