Show HN: I made a game for learning the country flags of the world
flagmatch.comI have always loved geography, and due to my childhood interest in football, I learned a lot of country flags.
A lot, but not all of them!
So, I decided to make a free game for anyone who enjoys flags and wants to improve their knowledge. You can compete against others because each game is timed.
Have fun!
The way flag appears can be exploited to get very fast.
We can memorize the last two matches position and alternate from there, as flags may not be there when names are popping but after at most one elimination the flag must have appeared (and if you enjoy try-harding you can refresh the website until you get the two first flags and names aligned, so almost no mouse move nor memory are needed)
Now you will have a 10-second penalty when you do this.
I seem to trigger the 10 second penalty in normal play through here and there even though I’m not cheating.
I see. Unfortunately, I don’t have enough time rn to deploy a proper fix. Thanks for reporting!
Yeah, I see what you mean. I have to think about how to prevent it.
It’s late here, and I have no quick, good ideas.
I'd generate new cards such that the number of pairs on screen is anywhere between 2-5. Which means sometimes you'd create two unpaired entries (which means the turn reduces the number of on-screen pairs by 1) or two different, but paired to existing entries (turn increases pairs by 1). You could sometimes throw in generating an outright pair because why not (turn maintains the number of pairs).
My Cheat for console
function i(t){const e=t.dataset.synsetid;const o=t.textContent.trim();if(!o.endsWith(`(${e})`)){t.textContent=`${o} (${e})`}}function t(){const t=document.querySelectorAll('div[data-game-target="word"]');t.forEach(i)}t();const e=function(e,t){for(let t of e){if(t.type==="childList"){t.addedNodes.forEach(t=>{if(t.nodeType===Node.ELEMENT_NODE){if(t.matches&&t.matches('div[data-game-target="word"]')){i(t)}}else if(t.nodeType===Node.TEXT_NODE){const e=t.parentElement;if(e&&e.matches&&e.matches('div[data-game-target="word"]')){i(e)}}if(t.querySelectorAll){const o=t.querySelectorAll('div[data-game-target="word"]');o.forEach(i)}})}}};const o=new MutationObserver(e);o.observe(document.body,{childList:true,subtree:true});
Thanks! Will have to see what I can do about it to prevent it.
Is your nickname "aptitude"?
Btw, I wish you shared this privately with me.
What for? Are you trying to make the rankings of this somewhat serious? Are you aware that even with this patched, it remains trivial to build an user script that automatically replaces the flag with the country name? Probably within half an hour you could have a script that also plays the game for you! This feels a lot like how NFT owners wanted people not to be able to right-click and save their "property". This is how the internet works, you can run stuff on your machine that does absolutely anything with the data that is sent to it. Sure, you could choose to fight back. You could move from emojis to images of flags with random filters and distortions applied, or implement some click tracker that checks if the mouse/finger movement is natural, or even something more complex and effective. But the question is: should you? Should you really destroy the beautiful simplicity of this game in order to make the leader boards more accurate? And does anyone really care about the leader boards?
> Are you aware that even with this patched, it remains trivial to build an user script
Copy-pasting code feels even more trivial. Writing a script requires some effort.
It feels unfair to people who are not tech-savvy.
Sharing something like this in private is being friendly to me and letting me know that this kind of stuff possible. Honestly, I knew it wasn't bullet-proof, but I simply didn't have the time and brain capacity to envision all of the possible attack vectors.
Sharing this in public is helping others ruin the experience easier.
I got romania and chad alongside each other, that certainly made it harder lol.
Yeah, that's a hilarious situation :)
Chad and Romania don't want to change their flags!
Very fun and responsive but I ended up in a chain of "off-by-one" where there was a country/flag whose partner was NOT visible at the moment but was the next to pop up.
Yeah, the “off-by-one” rule is there so that you cannot match the same slot over and over.
Im thinking about a similar thing for plant-species. Knowing them makes being outside a whole different experience!
Is there a large community of plant enthusiasts?
Kinda related, but I use the Seek app extensively to identify plants and it seems to work really well!
Thanks, my daughter loves it. She wanted me to tell you she's only 10 and got 2nd on the leaderboard.
Aww, that’s really sweet
My daughter is 2 years old, and she can’t enjoy it yet.
And wow, good job!
Simple, but with excellent execution. Greatly enjoyed practicing with this, and bookmarked so I can return
Thank you
Is this open source ?? We can use the same template for other games too if open sourced !!
It's not open source at the moment. I did a lot of cowboy coding and I am ashamed to publish it :D
On the one hand I feel you here. I am rarely that proud of stuff I do. On the other hand you accomplished something that just works, so it’s obviously good enough. It will benefit others if you share the sources. No matter what the code looks like.
For some reason the game is highlighting the correct answers for me before I click them.
It's a hint. It is shown every 4 seconds if you're not clicking on anything.
Do you think it would be better if hints were a separate button?
Yes please! It’s a great game, but it’s giving unwanted spoilers.
Give a Hint button where you “pay” some time to use it.
Thanks for making it!
Done! Now you need to press the "Show hint" button.
Make it so that it’s always there so you don’t have to wait, but you pay in time. Otherwise if you’re like me and don’t know many flags but you’re trying to learn, you sit there waiting for the button to appear.
That's an interesting idea.
On the contrary, relying on the "Show hint" button all the time is not that great. Why not to try and guess while the button is hidden?
Thank you very much!! Will play some more now :))
Perfect, that was my thought as well! Will do
Thanks, great job! I very much liked it, and so did my daughter!
You're welcome! I am especially pleased to know that your daughter liked it :)
My 2-year-old daughter can't appreciate it yet.
This is great. My 11 year old thanks you!
<3
vexillologists would definitely love this
Yeah, and hopefully geography lovers like me as well