8
11 Comments

👨‍💻 "Guess My Number!" game built with JS

Hey Indiehackers,

I just finished building a number guessing game with HTML, CSS, and JS.

I would appreciate feedback on my code on Github. Specifically, if there's anyway I could improve my code, please comment below!

Thank you :)

posted to Icon for group Developers
Developers
on October 29, 2021
  1. 2

    Cool project, love the retro style.

    My feedback would be to provide better indication that you have clicked the Check button.

    Sometimes I was not sure if my click did anything because nothing changed in the page, considering the message was still be same, although the Score value was decreasing, this was not obvious for me.

    Maybe had a simple animation to the message or something that provides a visual effect.

  2. 2

    Under script.js, a possible improvement for the next step is to refactor the message output into a separate function, so that you can follow the DRY (don’t repeat yourself) style of coding.

  3. 2

    Neat game! I played a few rounds which led me to find a bug. I opened an issue and submitted a PR for it.

    If you're doing this as a project to learn, adding features which introduce greater complexity can be great in helping you "level up" so to speak. For example, try making the number range configurable so you can play rounds with different ranges.

  4. 2

    I like the art style. It reminds me of retro video games. As I was playing it I thought it would be nice to allow for "enter" key to submit the guess. Since I can use up/down arrows to change the amount already.
    Fun stuff.

    1. 1

      Great feedback! Thanks.

  5. 2

    Nice stuff! Could use some mobile improvements, but overall great job!

    1. 1

      Thanks! Yeah it's not meant to be the best designed game, I built it just to get better at JS. Let me know if you see any ways I could improve the JS code.

      1. 1

        This comment was deleted 3 years ago.

Trending on Indie Hackers
I Was Picking the Wrong SaaS Tools for Two Years. Here's the Mistake I Finally Figured Out. User Avatar 120 comments Drop your landing page URL. I'll use Ferguson to tell you why visitors might be leaving User Avatar 100 comments Most early-stage SaaS companies miss churn signals — here’s how to catch them early User Avatar 31 comments Why Remote Teams Stop Talking (And Don't Even Notice It) User Avatar 24 comments Built a local-first Amazon profit-by-SKU + QuickBooks/Xero journal tool. Looking for founding users. User Avatar 19 comments How I Run a 1.7M Product Search Engine at 66ms on a $0 Hosting Budget User Avatar 19 comments