Page 1 of 1
Technical advice: keeping score.
Posted: Wed Feb 14, 2024 9:07 pm
by PoetBird
Hi. I am looking to create a tease that involves keeping track of various variables. Similarly to a personality test, I'd like to give options and keep track of answers. "Mostly As, Mostly Bs" kind of things. Does anyone know how to accomplish this in EOS? My coding skills a very rudimentary but I've taken formal logic classes.
Re: Technical advice: keeping score.
Posted: Wed Feb 14, 2024 10:42 pm
by undeniable_denial
I'm not familiar with what you're describing, but a quick googling tells me that it's just counting how many As, Bs, Cs etc you choose and the highest wins?
If that is accurate, then I believe it's enough to just do `a++;` when you press the button with answer A. In the end you would have to figure out which variable holds the highest number. If there aren't too many letters you can do it with a bunch of comparisons. If there are many letters, you might need a sorting algorithm.
Re: Technical advice: keeping score.
Posted: Sat Feb 17, 2024 3:25 pm
by PlayfulGuy
I made a quick demo for you.
Basic Counting
You can download the JSON to have a look here:
Basic Counting JSON
The value of the three variables A, B and C is initialized in the init script (under Options in the tease editor).
Each button increments the counter for the respective variable, then goes to some other page. In this demo they all just go back to the start page.
Good luck!
PG