<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aguuber</title>
    <description>The latest articles on DEV Community by Aguuber (@aguuber2).</description>
    <link>https://dev.to/aguuber2</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4256541%2Fe73670de-f95b-4906-b791-f2deba78fc31.jpg</url>
      <title>DEV Community: Aguuber</title>
      <link>https://dev.to/aguuber2</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aguuber2"/>
    <language>en</language>
    <item>
      <title>I built a Wordle-style math game in a single HTML file that has turned into a daily morning rivalry with my dad and daughter</title>
      <dc:creator>Aguuber</dc:creator>
      <pubDate>Sat, 21 Nov 2026 01:36:47 +0000</pubDate>
      <link>https://dev.to/aguuber2/pressing-enter-ruins-flow-state-what-i-learned-watching-58-strangers-play-my-60-second-math-game-j64</link>
      <guid>https://dev.to/aguuber2/pressing-enter-ruins-flow-state-what-i-learned-watching-58-strangers-play-my-60-second-math-game-j64</guid>
      <description>&lt;p&gt;In 2022, right when everyone was obsessed with Wordle, I paid a freelance developer on Fiverr to build a simple idea I had in my head: a 60-second daily mental math game.&lt;/p&gt;

&lt;p&gt;They built what I asked for. It worked fine. And nobody played it, including me.&lt;/p&gt;

&lt;p&gt;It just felt clunky, like a digital worksheet. So I closed the folder and left it sitting on my hard drive for four years.&lt;/p&gt;

&lt;p&gt;A few weeks ago I dug the idea back up. I wanted a quick numbers game that my dad, my daughter, and I could play every morning the same way we play Wordle. So I threw out the 2022 code and rebuilt &lt;strong&gt;&lt;a href="https://www.mathing.co/" rel="noopener noreferrer"&gt;Mathing&lt;/a&gt;&lt;/strong&gt; from scratch in a single HTML file.&lt;/p&gt;

&lt;p&gt;No frameworks, no sign-ups, no ads. Just a 60-second timer. Now it's a daily morning rivalry in our family group chat.&lt;/p&gt;

&lt;p&gt;If you want to see how fast you are before reading how it works, today's puzzle takes 60 seconds:&lt;br&gt;
&lt;strong&gt;&lt;a href="https://www.mathing.co/" rel="noopener noreferrer"&gt;Play today's Mathing at mathing.co&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(The average score across all players this week is 24. The highest score anyone has hit so far is 55. If you beat 30 on your first run, drop your score in the comments.)&lt;/em&gt;&lt;/p&gt;


&lt;h3&gt;
  
  
  Why most speed math games feel slow: the Enter key
&lt;/h3&gt;

&lt;p&gt;When I tested early versions of the game, something felt off.&lt;/p&gt;

&lt;p&gt;Suppose the screen shows &lt;code&gt;14 + 19 = ?&lt;/code&gt;. You know the answer is &lt;code&gt;33&lt;/code&gt; almost immediately.&lt;br&gt;
Still, your hand has to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Press &lt;code&gt;3&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Press &lt;code&gt;3&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Reach over and hit &lt;code&gt;Enter&lt;/code&gt; (or tap a submit button on your phone)&lt;/li&gt;
&lt;li&gt;Wait for the next question to load&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At that point you aren't testing mental math anymore. You're testing how fast your thumb can jump back and forth to the Enter key.&lt;/p&gt;

&lt;p&gt;To fix that, I got rid of the Enter key completely.&lt;/p&gt;

&lt;p&gt;The whole game is built around one constraint: &lt;strong&gt;every answer is a single digit from &lt;code&gt;0&lt;/code&gt; to &lt;code&gt;9&lt;/code&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The problems themselves still use two-digit numbers (&lt;code&gt;63 ÷ 9 = ?&lt;/code&gt;, &lt;code&gt;15 - 8 = ?&lt;/code&gt;, &lt;code&gt;7 × 1 = ?&lt;/code&gt;), so you still have to calculate. Because the answer is always a single digit (&lt;code&gt;0-9&lt;/code&gt;), the moment you press a number key, it submits and the next problem appears immediately.&lt;/p&gt;

&lt;p&gt;No Enter key, no backspace, and no multi-digit typing. Once you get into a rhythm, the game moves as fast as you can read.&lt;/p&gt;


&lt;h3&gt;
  
  
  The 0ms transition problem
&lt;/h3&gt;

&lt;p&gt;Once you remove the Enter key, people play much faster, and normal UI animations start getting in the way.&lt;/p&gt;

&lt;p&gt;In my first build, tapping an answer flashed the box green or red for 250ms before showing the next equation.&lt;/p&gt;

&lt;p&gt;That felt awful. If you answer 40 questions in a minute, a 250ms pause on each one eats up &lt;strong&gt;10 full seconds&lt;/strong&gt; of your 60-second timer.&lt;/p&gt;

&lt;p&gt;On the other hand, when I made the next problem appear in &lt;code&gt;0ms&lt;/code&gt; with no animation at all, it was jarring. If two problems in a row looked similar, you couldn't tell if your tap had registered.&lt;/p&gt;

&lt;p&gt;I ended up splitting the answer box into two layers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The actual equation updates in &lt;strong&gt;0ms&lt;/strong&gt;, so your eyes can read the next problem right away.&lt;/li&gt;
&lt;li&gt;A separate overlay (&lt;code&gt;#answer-ghost&lt;/code&gt;) flashes the number you just pressed in green or red for 300ms on top of the box without blocking your next keypress.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;showFeedback&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;correct&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;elAnswerGhost&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;className&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'eq-answer-ghost'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;elAnswerGhost&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="n"&gt;elAnswerGhost&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;offsetWidth&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Restart CSS animation on rapid keypresses&lt;/span&gt;
  &lt;span class="n"&gt;elAnswerGhost&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;className&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'eq-answer-ghost '&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;correct&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="s1"&gt;'ghost-correct'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'ghost-wrong'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Forcing a reflow with &lt;code&gt;void elAnswerGhost.offsetWidth;&lt;/code&gt; lets the green/red flash restart cleanly even when someone is answering two questions a second.&lt;/p&gt;


&lt;h3&gt;
  
  
  Giving everyone the same daily questions without a backend
&lt;/h3&gt;

&lt;p&gt;For a family rivalry to be fair, a score of &lt;code&gt;38&lt;/code&gt; on my phone has to mean the exact same thing as a &lt;code&gt;38&lt;/code&gt; on my dad's phone. If one person gets easy addition and someone else gets division, the scores don't mean anything.&lt;/p&gt;

&lt;p&gt;Instead of running a backend database to serve daily puzzles, the game uses a 25-line seeded random number generator in the browser, seeded by the local date (&lt;code&gt;YYYY-MM-DD&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;SeededRandom&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seed&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kc"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x80000000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kc"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1103515245&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kc"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12345&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kc"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;seed&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;seed&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At midnight, the date string hashes into a seed and generates a sequence of 300 problems. Everyone playing today's Daily mode gets the exact same problems in the exact same order.&lt;/p&gt;




&lt;h3&gt;
  
  
  Plugging the loopholes players found this week
&lt;/h3&gt;

&lt;p&gt;Earlier this week, a player named Adam emailed me a few loopholes he found after playing a couple of rounds (he scored 34, then 41):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Quitting mid-round to retry:&lt;/strong&gt; If you messed up the first 10 seconds of the Daily puzzle, you could tap &lt;code&gt;Home&lt;/code&gt; (or refresh the page) before time ran out and start the Daily over, having already seen the first 15 questions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UTC vs. local midnight:&lt;/strong&gt; &lt;code&gt;new Date('2026-10-01')&lt;/code&gt; parses as UTC midnight in JavaScript, while &lt;code&gt;new Date(2026, 9, 1)&lt;/code&gt; uses local time. Because of that, the puzzle number (&lt;code&gt;#47&lt;/code&gt; -&amp;gt; &lt;code&gt;#48&lt;/code&gt;) was flipping at 7:00 PM EST, five hours before the actual questions reset at local midnight.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I pushed fixes for both last night. Today's daily run now locks as soon as the timer starts, and the puzzle number rolls over at local midnight right alongside the question seed.&lt;/p&gt;




&lt;h3&gt;
  
  
  Give today's puzzle a shot
&lt;/h3&gt;

&lt;p&gt;If you have 60 seconds to spare, try today's daily round here: &lt;strong&gt;&lt;a href="https://www.mathing.co/" rel="noopener noreferrer"&gt;https://www.mathing.co/&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here is where the numbers sit over the past 7 days:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Average daily score:&lt;/strong&gt; &lt;code&gt;24.2&lt;/code&gt; solved&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Current high score:&lt;/strong&gt; &lt;code&gt;55&lt;/code&gt; solved (&lt;code&gt;95%&lt;/code&gt; accuracy)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you play a round, click &lt;strong&gt;Share&lt;/strong&gt; at the end and paste your score in the comments.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>showdev</category>
      <category>gamedev</category>
    </item>
  </channel>
</rss>
