Inspiration
I was inspired by games like GeoGuessr, my interest in math. I had the idea when someone decided to list an integer sequence using Twitch's 'bits,' leaving everyone scratching their head.
What it does
It generates questions based on all the OEIS entries it knows of. Question variations include figuring out which sequence fits some given terms (multiple-choice), guessing the next term of a sequence, and guessing as many terms of a sequence as you can under a time constraint.
How I built it
I started with the default template from create-react-app. For the most part, I approached implementation by question variation. Since the two OEIS files the game uses are large (they cover all the OEIS entries at the time I downloaded them), trying to process them both in the browser can lead to out-of-memory errors. So, I decided to do some of that work server-side.
Challenges I ran into
Creating a timer for some questions to use was hard because of the way requestAnimationFrame interacts with React's state hook. Since I was reusing the callback to requestAnimationFrame, it would use stale state, leading to defects like the timer not starting nor stopping when it should.
Accomplishments that I'm proud of
This is one of the few games I've worked on--I'm glad I got to do something outside my comfort zone!
What I learned
I gained experience using and creating React Hooks. In particular, I learned how to encapsulate impure effects like randomness and time into hooks. I also learned how to create a basic Express server.
What's next for OEIS Sequence Guesser
There are some things I'd like to fix, like:
- For some reason some sequences aren't processed by my server, and so they seem to be missing as far as the client is concerned.
- Some abbreviations, such as 'G.f,', appear in names. I ought to explain those.
- There are some glaring accessibility issues.
Additionally, I'd like to include other types of questions, add a difficulty system, and make it so that one is asked a series of different kinds of questions. The latter will make the game feel like a complete experience, instead of being just a question generator.
Log in or sign up for Devpost to join the conversation.