alt.hn

5/2/2026 at 5:04:39 AM

Show HN: Stop playing my matchstick puzzles, start building your own in seconds

https://mathstick.github.io

by trangram

5/2/2026 at 5:04:39 AM

Mathstick 2 is now ready!

Same as my first version, you can earn sticks to unlock the next level and the challenges get harder as you progress. With the newly added Puzzled Maker, you can now create your own matchstick puzzles and generate a shareable link to stump your friends :)

For example, check out this custom challenge I just created: https://mathstick.github.io/play?q=ktoylsjcnmylbetuinmylielj...

Feel free to share your puzzles below and feedback is welcome.

by trangram

5/2/2026 at 11:23:48 AM

The answer to all of these should be moving a stick over the equality sign to change it to an inequality sign.

by cyanmagenta

5/2/2026 at 11:28:25 AM

This is too tricky to be allowed. Let's play a fair game :D

by trangram

5/2/2026 at 3:57:08 PM

Nice job. I'd seen similar things in the past but I had no idea this was an actual type of puzzle.

Your game has a bug which is relatively common in drag-and-drop games. If the viewport is smaller and I drag a match off-screen by accident, it can get stuck to the edge. Then it can become detached in such a way that makes it impossible to recover the match.

https://en.wikipedia.org/wiki/Matchstick_puzzle

by vunderba

5/4/2026 at 1:29:20 PM

Fix the off-screen issue. Now the previous stuck stick will be reset to the original place on your next drag. Thanks for pointing this out. And you probably need to refresh the browser to see the new update

by trangram

5/3/2026 at 1:40:09 AM

Thanks for trying this out. I'll fix the off-screen issue later.

I created this game because of an old news my wife shared with me, it was about The New York Times bought the Wordle game. I was then surprised that such a simple, old-style game caught the attention of a big company. I said "I'd rather play a matchstick puzzle", and it was that moment that inspired me to create a free online version with all the puzzles procedurally generated by my own hand-made solver (I like the sound of this :D). Personally, I like moving one and only one matchstick to solve a puzzle rather than 2 or 3 sticks, also I don't like those tricky solutions like negative number, rotation trick and etc. although they could be a very creative solution and let you think outside the box sometimes, IMO, it is just not elegant and sometime distracting to encourage people to think in a systematic way.

by trangram

5/3/2026 at 1:54:22 AM

You made me chuckle a bit with the whole “hand-made solver” thing with discrete puzzles like this, since 99% of the time to create a new puzzle, you just start with a solved problem (arithmetic equality) and introduce a sequence of random valid moves to put it in a unsolved state.

I remember one of my freshman computer science assignments was to make a Rubik’s Cube game. That was when a lot of undergrads were first introduced to the idea of using a stack and then "unwinding" it to simultaneously build the problem + solution.

by vunderba

5/3/2026 at 2:16:08 AM

yeah, the solver behind Mathstick is pretty much like what you described: building the problem + solution simultaneously, besides you also need to collect the multiple solutions for the same question and information for further classifying the difficulty of a puzzle.

Just like "hand-made" pizza used as a response to the rise of frozen, factory-produced pizza and to establish authenticity against fast-food chains. Maybe "hand-made" will be used to emphasize a app/software is made by human rather than being vibecoded or completely AI generated in the future. Also, if you use the Puzzle Maker to create your own puzzle, it becomes a "hand-made" puzzle :)

by trangram

5/2/2026 at 7:27:52 AM

I think I broke it a little, playing around with INT64_MAX - https://mathstick.github.io/play?q=hrojihaacciabcmtskiistbij...

Edit: mostly directed at OP, the puzzle maker claimed something like 12 identical solutions for the same puzzle

by a_t48

5/4/2026 at 1:27:34 PM

Fix the integer overflow issue. Now your share link will only the first puzzle, the other two puzzles are invalid thus won't be shown any more. If you don't see any changes, you may need to refresh the browser to see the latest version.

by trangram

5/2/2026 at 7:40:35 AM

Yeah, you did! It's integer overflow, good catch!

by trangram

5/2/2026 at 7:08:29 AM

Nice! What did you build this with?

Also, submit it to https://hnarcade.com :)

by yuppiepuppie

5/2/2026 at 7:11:48 AM

js+css, angular only for fancy pop menu and dropdown list, no angular material though, as as to keep it simple and lightweight.

sure, will have a look. thanks!

by trangram

5/2/2026 at 8:26:16 AM

Highly recommend y'all try playing with the Puzzle Maker first! It’s a great way to get a feel for the shape of numbers and the different moves you can make.

I personally found this 'learn-by-doing' approach really helps me understand the patterns before I tackle the harder levels.

by trangram

5/2/2026 at 1:15:53 PM

nice game! may i know what amount of js/css knowledge should i possess to be able to write sth like this? Eloquent JavaScript + any generic CSS book enough? thanks for making my evening.

by eager_learner

5/2/2026 at 1:41:01 PM

thank you and glad you love it, those books are more than enough.

As for the css part, I would suggest you start by building the layout for the desktop first. Once the desktop version looks good, use media queries to adjust the design for mobile and tablet sizes.

As for js and html part, think in Components: Instead of one giant file, break your code into "modules" or "components". In my matchstick game, I built the "Puzzle Display" as a standalone component. This allowed me to reuse the exact same code for the main game, the puzzle creator, and the shareable play pages.

For specific effects or tricky logic, Google and LLMs (like ChatGPT) are great resources. Avoid "copy-pasting" code you don't understand. Always try to deconstruct how a solution works before adding it to your project. Use these tools as teachers, not just shortcuts.

Most importantly, enjoy what you are doing. Let me know if you need more info, I'm more than happy to help. Good luck to your coding journey.

by trangram

5/3/2026 at 4:02:26 PM

Thank you so much for the wonderful advice! It's so refreshing to see humans act and be human-- helping each other despite not knowing each other.

For context, I've been stuck in tutorial hell for years! Part of it can be blamed on my ADHD, which is a serious disability if you want to finish any task. Still, I've been trying to make inroads at it... I've been reading several books at the same time, but stuck on chapter 3 or 4 in each. Then I begin looking for other books until I hit a block in it--then process restarts again.

You're right that LLMs do help a lot. I think I made more progress in the last six months than the past pre-LLM two years.

Thanks and kinds regards.

EL

by eager_learner

5/4/2026 at 2:24:51 AM

Thank you for sharing your story. Actually I didn't read any physical books to learn js and css, I learned both of them online and practicing them in my hobby projects, practicing is the only way that helps me finally grasp concepts of a programming/language and improve my coding skills using that specific language. I started learned css and js 17 years ago on https://www.w3schools.com, I decided to learn css just because I found it was so cool you can change the style of your website completely by replacing your css file with a different one. But later I used Java more frequently than other languages for 5 years due to my job need, and naturally I almost forgot all what I learned about js and css skill. It was around 2013/14 that js picked up my interest again due to the hit of nodejs at that time, so I turned to online to learn js again, this time learned it on https://javascript.info, yeah there are many resources to learning things, maybe nowadays people prefer LLMs, it's totally fine, just find the one that suits you. But remember you don't need to finish all those topics or concepts before you start your own project. Practices make your skill better if not perfect. Use those resources as references, you don't have to learn it chapter by chapter, everyone has different learning style. Programming is a long journey (and what any things else are not?), let your passion guides you, let you interest/hobby be your best teacher :) Best wishes ~

by trangram

5/2/2026 at 2:51:00 PM

I appreciate the good faith effort here to learn (and advise on) programming skills! It’s rare nowadays.

by cwackerfuss

5/3/2026 at 4:05:03 PM

Thank you. It's something I am really passionate about. Given my 'day job' and 'family time' and battling an uphill swim against my ADHD, I am still happy with the progress I've made so far. I feel like I'm almost there.

by eager_learner

5/2/2026 at 3:04:50 PM

Exactly. We only find real fulfillment when we work on what we’re passionate about. We need to value the process more than the outcome.

by trangram

5/2/2026 at 10:10:01 AM

Nice one. I spent about 15 minutes playing, thank you.

by oleggromov

5/2/2026 at 10:49:08 AM

Glad you enjoy it!

by trangram

5/2/2026 at 5:06:13 PM

This is very addictive! Love it.

by mvitorino

5/3/2026 at 1:14:06 AM

I thought this game might be too tough. You're actually the first one besides my wife who's told me it is addictive.

by trangram

5/3/2026 at 3:20:13 AM

Thank you! Glad you find it addictive, enjoy the game :)

by trangram

5/2/2026 at 7:54:46 AM

Would you be willing to add a manifest so this can be "installed" as an app on Android?

by ncruces

5/2/2026 at 8:02:40 AM

sure i'll consider converting it to PWA if people prefer playing the main game than creating and sharing puzzles with the Puzzle Maker.

by trangram

5/2/2026 at 8:39:33 AM

I think you can just pretend to be a PWA, no need for code changes.

You may need an unused service worker, or not, I don't remember.

This just means your site looks like an Android app (but still needs net, etc).

by ncruces

5/2/2026 at 8:47:25 AM

Thanks, I used to do something like that when I made a tabletop like card maker using three.js + angular 8, but it has been a long time ago, I need to catch up with the details how to implement it with angular v21 since it is almost a completely new framework compared to the old versions

by trangram

5/2/2026 at 7:38:54 AM

Typo: invetory

by dvh

5/2/2026 at 7:48:49 AM

may I know which page it is?

by trangram

5/2/2026 at 7:45:52 AM

good eye~ thanks

by trangram