Posted: 30th Apr 2021 3:33
Hey everyone,

I am new to AppGameKit and I have some ideas for quiz gaming.
I am an English teacher in Japan and I would like to create a game similar to a part of duolingo.
I attached the part I would like to try and recreate.
I was thinking of having a tsv or csv file that contained the individual questions separated as English, Japanese, picture file location, sound file location but I started to have doubts if that would work.
My idea was to create a type (question) per line that was separated into 4 categories with the above information.
The English string would then be separated into an array via spaces and shuffled. What I am wondering is how to display this on the screen like Duolingo does.
Would it be better to create buttons that have the text from the array displayed or is there a better method to do this?

Any help or ideas for coding this would be appreciated.
Posted: 30th Apr 2021 4:17
Would it be better to create buttons that have the text from the array displayed or is there a better method to do this?

i can't think of a better way.

either AppGameKit (virtual) buttons or Text objects could help, along with an Edit Box should solve both input methods.

and, i think the way you want to break the solution up would work fine using " " as a delimeter for parsing and breaking the sentence up for individual words/buttons.
Posted: 30th Apr 2021 6:11
Thank you for the quick reply. I will attempt that when I am on a computer that has AppGameKit!
I was wondering if you had any advice for the organization of my data?
I was planning on using google sheets or excel to create the tsv. Would I have to use the ascii 9 value - Chr(9) - to evaluate my different lines?
Also is there a way to select a specific line or do I need to upload the entire tsv from the begging?
Example file:
I love AppGameKit (tab) AGK???????(tab) AGK.png (tab) AGK.wav
I like blue (tab) ????????(tab) blue.png (tab) blue.wav
I like rabbits (tab) ?????????(tab) rabbit.png (tab) rabbit.wav

If I want the question about rabbits do I need to read every question before it or is there a way to specify what line from the file I want to read?
For something this short I don't think I would notice a difference in speed but I actually have created a database of questions over the last 8 years that spans over 10,000.
If say I want to load question 9,342 do I need to read over all the previous questions?
Posted: 30th Apr 2021 9:07
i've got word lists with ~100k words, 1 word per line. AppGameKit handles it fine (on windows build - html, another story. same for android, IIRC).

i wouldn't be afraid to open your file of 10k lines and feed it into a typed array all at once but SetFilePos() should do what you want if you know the Qs line in the file (no personal experience with the command).

otherwise, i've never used TSV and i'm unsure if it would understand a TAB but i expect it would. i just tend to use a pipe | when i build a file like we're talking about so i can read it the same way

meanwhile, sounds like you might have reviewed some commands already but make sure to check GetStringToken and related commands.

and, while i'm thinking about it, you'll need to find an font with the japanese characters, some info on utf fonts here
Posted: 30th Apr 2021 14:52
I think you can use Chr(9) in StringToken for TAB, Chr(13) for CR, Chr(10) for LF, or run a S&R on the file and use CSV, personally speaking for 10k items I'd use SQLite, run a script on the raw file to generate a SQL injection statement and your good to go, instant access and no waisted memory.

I made something like this a few years ago using Dolch words, I think I used CSV for that but there were only a few hundred words and less that 100 questions (use cases for the words)
Posted: 6th May 2021 14:00
Thank you guys for your input. Do you have a link where I can find some information on SQL? I really am a beginner when it comes to reading and writing files. I used to use python to create bots for rpgs, did not like the grind, but there was no file reading with that.
Posted: 10th May 2021 4:46
If say I want to load question 9,342 do I need to read over all the previous questions?

Yes but shouldn't be a problem. I did a word game that uses a dictionary file, and that's, well, every english word! Had no issues with it.