note: i did NOT create the ASCII art. I’m not good enough to do that. I found on various ascii art archives as well as those image to ascii art converters for the continents I couldn’t find.

countryguess was a project I made recently because I wanted to make a quiz that could be customised as you see fit. Also, I had no clue how to make GUIs with Python and ASCII art is cool so I decided to roll with it. It turned out pretty cool!

I made the maps by printing the ASCII art map, and then all the spaces that make up each country would be an array. These arrays would fill up the spaces like morocco[0], morocco[1], etc.

Then, when the country is guessed, the country (or an alternate name/abbrviation, such as uk for the united kingdom or ivory coast for cote d’ivoire) is matched with its index in the list of countries in that continent.

A second list contains all the countries that show up on the map (excluding citystates, islands, etc. that aren’t big enough to be shown on the map) and has all the countries as either 0 (false) or 1 (true). Whenever the country is guessed, its respective list item turns into 1.

The map printing function checks each list item for whether it is true or false. If it is true, then the list of spaces for that country would be replaced with a list of equal length and equal number of characters but with hashes “#” instead of spaces " ". This means that, when the county is printed, hashes are printed instead of spaces and the country fills up

I’ve got africa, europe, north america, and oceania completed. I haven’t yet made the map for asia because it’s HUGE, and south america I haven’t done yet as well. Also, central/eastern europe is VERY out of proportion and will be fixed…eventually. (i.e. long romanian panhandle)

other fun features I added include the ability to enable/disable disputed territories (Western Sahara, Kosovo, and Somaliland bc why not) and the U.N. observer states (the Vatican and Kosovo) as well as score saving to a “scores.txt” that shows the date, time, and name of quiz that you complete along with your score.

once I finished all the continents, I’ll work on making a world quiz with ALL the countries. other things like capital quizzes and flag quizzes could be added on later, but that’s likely very far into the future.

here are some more screenshots:

europe europe

oceania oceania

north america north america

the github link if you want to look at the code or just have a go at the quiz: https://github.com/swarbler/countryguess

    • sbird@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      21 hours ago

      python is fun, the syntax is very easy and it makes it simple to just go make a cool project

      • The Bard in Green@lemmy.starlightkel.xyz
        link
        fedilink
        English
        arrow-up
        1
        arrow-down
        1
        ·
        edit-2
        6 minutes ago

        As long as I continue to sometimes waste hours of my life on irresolvable dependency hell, after exactly following the “deploy my project” instructions, trying with multiple environment managers (venv, conda, poetry), watching my system environment somehow get broken even though I’m using some kind of virtual environment (happened to me just last week), I will continue to AGGRESSIVELY have the opinion that

        • The only reason we’re all still here is everybody else is.
        • The only reason someone would actually voluntarily CHOOSE this tech stack, in 2025, is for comfort zone reasons, they don’t know any better reasons, their boss told them to reasons, or the libraries they need are ONLY here reasons.

        Thus the Facebook of programming languages.

        And oh yeah, “so use docker.” Dude, if your ecosystem only works reliably in carefully controlled containers, in 2025, the problem is your shitty shitty, stupid, chronically broken ecosystem, not me for being frustrated with it.

        This problem IS AND HAS BEEN so bad that every few years someone does a WHOLE NOTHER BIG PROJECT to try to solve it, so now we have multiple buggy ass environment resolvers, non of which work well enough to be considered anything other than an embarrassment to the community, when compared with say modern Lua or Rust ecosystems.

        Like this stack ALL YOU WANT, I not only don’t get it, I’m (I believe justifiably) grumpy and frustrated because when I want to use your shit, now I have to use this crummy stack. Thanks for that Python advocates. I’m so grateful to you for that. Thanks so very very much.

        THUS the Facebook of programming languages. Facebook is “fun” and “easy to get started with” too. Lua is JUST AS EASY to get started with, but its’ ecosystem doesn’t do this to me. Explain that, if you can.

        I know you’re human beings like me and you deserve compassion, but damn it, I have wasted SO MUCH TIME trying to get your broken, buggy ass shit to work, and I’m VERY frustrated about it. You’re not gonna talk me down.

        I don’t care about how easy or fun the syntax is. The syntax is irrelevant to me. I care about how borked up and bloated the ecosystem is, and how so many “here’s how you deploy my project” instructions fail horribly to work due to unexplainable dependency conflicts, and how fragile and unstable and specific and unforgiving the complex web of virtual environments (and their multiple different managers) are just to run some 5,000 line script someone wrote that requires shittylib 2.1.3 and pieceofgarbagemodule 0.5.1, but shittylib 2.1.3 requires abandonedproject 4.1.1 and pieceofgarbagemodule 0.5.1 requires abandonedproject 3.0.99 and “pip failed to resolve dependencies after 15 minutes of installing shit because we didn’t write it to do that, fuck you, hahaha, modify your requirements.txt to use a different version of abandonedproject lol!” That shit is unacceptable in the modern world, given the alternatives.

        I will die on this hill, regardless of hate and downvotes.