Math Arcade Game Guidance

Hi,

I'm building a math arcade game, and I need some guidance. The idea of the machine is that there will be a series of questions printed out of the machine (thermal printer), the kids will answer the math questions through a numeric keypad, and be awarded tickets from a skee-ball ticket dispenser.

I can create the questions, and print them out with the thermal printer. I can accept input from the numeric keypad, and check that the answer is the same as some value. What I'm struggling with is storing the answers and then checking them later.

My first thought was to store and array in EEPROM for each quiz like so:

(00001, 1245, 356, 755, 4501, 11294)

where the fields are:

(quiz number, answer 1, answer 2, answer 3, answer 4, answer 5)

I suppose those answers could be any number from 0- 19,998 the way I'm currently building them.

I'm not really sure how to store them in EEPROM and then get them back. Maybe the 'test number' is the actual length of the data stored in EEPROM?

So then a kid brings the printout to the machine and enters the 'test number' and that is the address in EEPROM to retreive the answers from? How would I know what the end address was?

I saw the older post and playground about EEPROM Write Anything, but in the playground I have no idea if that is an old post and has been superseded by some other EEPROM libraries or something.

Maybe I should punt on the printout, and start simple with just displaying the question, waiting for each answer and then dispensing the tickets. Or maybe this project would be better suited to a small linux computer where I could store more tests and access them in easier ways?

All thoughts welcome,

Thanks!

Jimmy

I'm not really sure how to store them in EEPROM and then get them back. Maybe the 'test number' is the actual length of the data stored in EEPROM?

If you change test number to length, how will you find the data from test 7? You need to store, I think, test number, answer length (as string), and answers. Then, you can iterate through EEPROM looking for the test number, knowing how many bytes to skip if the test number is not the right one, or how many bytes to read if it is the right one.

So then a kid brings the printout to the machine and enters the 'test number' and that is the address in EEPROM to retreive the answers from? How would I know what the end address was?

No. The test number should not be the address where the data is stored, It should be the test number. You need to find the address where the data is stored by iterating through EEPROM starting at some known address.

But, this is all silly, since the answers stored in EEPROM would become wrong as soon as the code (containing the questions) on the Arduino changed. Store the answers the same way the questions are stored. How that is is, of course, a mystery (to me, not you).

EEPROM_readAnything and EEPROM_writeAnything are still viable options. But, unless all the tests have the same number of answers, they are going to be very difficult to use, since you need to know what each anything is, in order to know how much data to skip for that anything, where the anything is the answer set for a lower numbered test (on a per test basis).

mixographer:
What I'm struggling with is storing the answers and then checking them later.

SD card?

Use an old notebook and DOS. Surely there is a copy of TurboC, QB45, or Turbo Pascal somewhere!

I trip over old notebooks daily and when I am here alone and everything is quiet, I swear I can hear them crying to be repurposed!

Not everything should be done with an Arduino.

Ray

Thanks for all the replies. I wondered about using the Arduino for this.

Paul, I don't understand why the answers become wrong after a software change. You said:

But, this is all silly, since the answers stored in EEPROM would become wrong as soon as the code (containing the questions) on the Arduino changed. Store the answers the same way the questions are stored. How that is is, of course, a mystery (to me, not you).

The kid has the 'test num', and the 5 answers would be in the array. The questions are randomly generated, so they are not stored. I don't store the question because I only care about the answer. The only thing the machine checks is if the kid put in the same number that the array held.

I guess the question is 'stored' on the printout, but it doesn't matter to me if the question is 1+2 =3 or 5 - 2 =3 as long as the kid puts in 3, I count it as correct and dispense a ticket. Maybe I didn't explain it well enough. That is an easy trap to fall into here.

It will probably be easier for me to write the software in Python or something on a linux box, but I think it will be harder for me to interface with i2c and the 74c922 I'm using for the keypad. The Arduino makes that stuff easy for me.

Thanks for all the ideas.

Jimmy

@Jimmy

think it will be harder for me to interface with i2c and the 74c922 I'm using for the keypad.

Use a Leonardo clone, 32U4 based, to interface the i2c & 74C922. The Leo gives you bidirectional communications to the PC.

Ray

This entire issue can be sidestepped by using a pseudorandom number generator to generate the questions, and seeding the generator with the quiz number.

Interesting. So if I use the test number as the seed, then random() will give me the same questions, in the same order, again.

I will try that. It sounds way simpler than what I was thinking! Store the answers for later.... Hah!

Thanks

So if I understand this, you have a number of quizzes where you have the answers stored in EEPROM and then derive questions somewhat at random to pose problems that give those answers.

I can't see why you need the quizzes pre-generated - it would seem simpler to generate them on the fly using random. If you really want them predefined though, just store them in progmem - more capacity than the EEPROM and simpler to use.

Thanks Bill,

I wasn't clear enough on the concept. The questions are generated with random and presented on a thermal receipt like

question 1:
2345 + 2000 =

There are 5 questions, and the student is able to take the receipt/test away and work the math. What I wanted to store was a list of answers to the questions that were asked. So that when the student came back to the machine to evaluate the answers, and collect the earned tickets, I would know that if they put in

question 1 : 4345

that they got the correct answer.

So I was trying to figure some way to store the answers where the student could come back and enter the test number and i could reference what the answers were, to the questions that had been asked previously.

Odometer solved it for me with the idea of just seeding Random() with the 'test number', whereby I could then "randomly" generate the same exact test again, without having to know what it was.

Thanks for all the answers I've received on this topic. I'll post something when the machine is finished. I'm having a hard time fitting the thermal printer and the skee-ball ticket dispenser in the cabinet I have. If my programming is bad, my enclosure building is even worse!

Jimmy

Mixographer,

Just make sure that, before you let the students at it, you have tested the machine to make sure everything is working -- including printing some practice tests, solving them yourself (deliberately including a "mistake" or two just to make sure the machine recognizes mistakes), and then using the machine to check the answers.

Thanks. We will test it out thouroghly, I've got two students here in the house who will be QA testers.

Thanks again for the brilliant solution.

Jimmy