I'm a 15-year-old house sitting for my brother while he is on a business trip in San Francisco. My brother is a major programmer it seems =O He has a whole wall devoted to books on programming in more languages than I thought existed. Anyway I picked up on of his old "Beginning C++" books, booted up his copy of MSVC++6 and started typing. I've never seen any C++ code, or any code at all(other than HTML/Javascript) so all programming is relatively new to me. I'm not the sharpest tool in the shed, so if I mess up go easy on me. ^^
Anyway~~ I found his copy of DBPro and studied the reference manual. I came to the decision of making a program that will read .txt files with the Japanese words I need to memorize and display them on screen. So basically:
1. A program that will read .txt files with Japanese words and their english equivalents tucked nicly into them. The program will show the Japanese word(or english) and prompt the user for the correct english word. If incorrect or correct, it'll let the user know - then move on to the next word.
Alrighty =D Now, this is what I have coded so far:
REMSTART This is the vocabulary list, it's a .txt file with
the words formatted like:
"JapWord1
JapWord2
EngWord1
EngWord2"
Basically easy to understand; JapWord1's english equivalent is EngWord1
REMEND
OPEN TO READ 1,"vocab.txt"
REM Arrays to store the Japanese and English words, as well as the User answer
DIM japan1$(5)
DIM english1$(5)
DIM answer1$(5)
REM Reading the japanese words from the file
for i=0 to 4
READ STRING 1,japan1$(i)
next i
REM Reading the English words from the file
for t=0 to 5 step 2
READ STRING 1,english1$(t)
next t
que=0
ans=0
eng=0
do
Vocab(que,ans,eng)
que=que+1
ans=ans+1
eng=eng+2
loop
REMSTART
The main function =D It's really easy compared to... any other function
I've seen some of you code guru's whip up =) Displays current japanese word, prompts
user for english word, stores it in answer array, then compared it to the english
word from the vocab list.
REMEND
Function Vocab(var1,var2,var3)
print japan1$(var1)
Print "What is the english equivalent? "
INPUT "",answer1$(var2)
If answer1$(var2)=english1$(var3)
Print "Correct~!! Push any key to continue"
Else
Print "Incorrect...Push any key to continue"
endif
wait key
CLS
Endfunction
My problems are: The 4th word, and all after that are always incorrect, and I can't figure out why. Also, a goal of mine was to randomize the words so i dont develop patterns after running the program a few times. Any advice, hints/tips are greatly appreciated. I'm not *even* a newb yet, I know. =X
NOTES: I searched around for string functions, maybe some useful DLL's, and came across TDK's string function library for DBV1. The GetWordStr() function is what i started out using, but I came to realize early on that Japanese words have more than a one-word meaning, and that function pulls out certain words. =O I was also hoping later on to use this program for praticing bunkei(pattern sentences).
If anyone can point out a good way to work on this little project, i would really really appreciate any information =D Maybe someone knows and easier way to do this? Maybe I'm missing something. I dont know ^___^ Tis' why I seek help.
Thanks~!