Hacker News new | ask | show | jobs
GitHubGuessr (github-guessr.vercel.app)
124 points by tan-z-tan 1022 days ago
16 comments

Nice! More time would be good (or a no time limit option). I like the element of being able to make inferences based on the code even if you're not familiar with it, narrowing down to a handful of candidate repos and making an informed guess - but this takes time and the 60s you get doesn't feel like enough to comfortably read the whole list of repos.

Being able to quickly eliminate languages might also be good - if you see some code that you know is Python, for example, a little filter bar would be a nice way of shortening the list. Great concept!

I wish the name of the project wasn't just available at the top. It should hide or omit files that its own name in the text
Thank you for your feedback!! Year, dropdown list UI should be replaced by tiles or something.
Agh, sorry, but having to read through a dropdown of dozens of items ruins this out of the box. Needs a re-work of guessing. Not fun and not even a game right now, but close!
Looking at the code and instantly I knew it's Huggingface's Transformers. Then I scrolled through the list for eons while the page kept hinting me things I already knew. That's just so frustrating.
It would be good to automatically filter by language as that's trivial to guess.

Then the remaining set could be placed in a 2D plane, organized through some sort of clustering in vector space.

> organized through some sort of clustering in vector space.

What did he mean by this?

Curious why you didn't write "what did you mean by this", addressing directly?

Anyway, if I had to guess, I'd say grouping along two or more traits. Maybe size along one axis and purpose along the other, clustering similar projects together.

I asked because as HN doesn't notify users about responses to their comments (right?) it would be more likely that someone else would read my comment and explain it to me, than the original commenter. I was also referencing an old 4chan meme but yeah, in hindsight it's kind of phrased weirdly.
So you could place each project on a 2D map with X and Y being obvious dimensions (size and purpose) as another commenter mentioned.

Or you could have something like an LLM's embedding model that converts a description of a github project into a series of numbers. Each number will be from 0 to 1. Hypothetically, the first number could represent the commercial-ness of the project. The second number could be how closely related the project is to web development, the third a relation to AI, etc. Embeddings for use with LLMs often have between 100 and 10,000 dimensions.

You could then use a dimensionality reduction technique like t-SNE (https://www.datacamp.com/tutorial/introduction-t-sne) that will take these hundreds or thousand of dimensions and squish them down to 2 or 3. That allows humans to explore the space intuitively. This way you get related projects close together. PyTorch and SciKit Learn will be near each other because they are both AI/ML related. And then Pandas will be in a different but nearby cluster. Ruby on Rails would be farther away.

In the end you get a 2D map where similar projects are grouped. This makes it much more like GeoGuessr. GeoGuessr only works because similar parts of the world tend to be near each other. The world doesn't have a square kilometer of desert in the middle of a rainforest. Locality is extremely relevant and it makes GueGuessr fun and intuitive.

Just throwing a bunch of projects in a list here ruins the game because you can at most have one dimension along with projects are associated.

But, given the list of projects is small it would be easier to simply have a person curate a map.

Seems overengineered, i agree the list in its current state is a bit awkward to scroll through but I'd just turn it into a 2xN grid sorted alphabetically.
Cool idea, a few suggestions:

1. Clicking on the "Select" dropdown gives me the (I believe) complete list of options, which is not that big, so it's easy for me to pick from those options instead of guessing. Autocomplete is alright (similar to Framed or Guessthegame) but I shouldn't be able to see all from the start.

2. If the previous becomes too hard, you could add a few more tries with more pictures if I failed, ideally these would come in decreasing order of difficulty, but I understand that ought to involve more manual work so you could make do with just more random pictures from the same codebase which might help me.

3. Finally, a "share" button which copies my score to the clipboard so I can share it with my friends would be cool. A "daily" challenge would be great too so I can make sure we compete on the same codebase as my friends (otherwise I might get an easier challenge) though this will probably imply getting a new codebase for each day, and making the list of options much bigger.

Cool idea, but first I got a file which immediately read "This source file is part of the Swift codebase" or smth, and them I got one which is just the characters "})", so pretty inbalanced. Took me a while to figure out that the arrows change between files.
I had the inverse: literally only a return statement impossible to guess:

            return output
          }
        }
      }
    }
  }
I guess this is one of the cases where an app should pretend to choose a "random" snippet, but actually the user doesn't want real randomness.
Seems like something that could be solved using tree-sitter[1], though it would probably be pretty involved.

1. https://tree-sitter.github.io/tree-sitter/

Well if you play geoguessr, you often just see the name of the city.
Yeah, my first one had an import for k8s.io or something so I could easily guess Kubernetes but the second one was just 3 lines of some generic import
Great game, something to pass the time in Uni waiting

One bug: I selected Selenium and it was wrong, then the next one I thought was also Selenium and it was. The drop down still has Selenium selected but an empty string was sent as the guess.

Thanks for making this!

NB. You can move the code around, by pulling on it ! I didn't realize that at first.

An interesting game.

Created GitHubGuessr: guess the repo from code snippets. Surprisingly challenging. Thoughts?
I would suggest to maybe replace the dropdown list with 12 or 10 tiles instead. would make navigation a bit easier (and the difficulty level less brutal, although that might just be me!)

this is a great game by the way! There might be scope for grouping the repos broadly by language. so when faced with some javascript code, the list of possible answers the user gets to pick from are all javascript-y repos. but this ofcourse makes it easier (maybe too easy).

The idea of presenting it with tiles is interesting. It can also avoid including too similar repositories. I'm currently working on grouping by language or theme. Thanks for the feedback!
Aw snap! I had this exact idea last year but didn’t build it yet. See GitShuffle here https://blog.waleson.com/2022/11/things-i-didnt-build-yet.ht... I even bought gitshuffle.com

Great to see it in a working version!

I think there’s serious potential in this if you do it on your team’s own code. It would be a fun game to play with your colleagues on a Friday afternoon.

Definitely should include more repos, its a little imbalanced towards web dev
Yeah, If you have any recommends, please let me know. I had ChatGPT help me create a popular repos.
Do what GeoGuessr (kinda) did and let the community help! For example, I can probably come up with a few repos (you can check them for star count or similar to ensure theyre not too obscure).
It is quite challenging. I think giving a bit more context would bring it within an enjoyable range; e.g. showing the entire file, including the full path
Just like in geoguessr you could have different game modes. Or maybe you can move choose to step through the repository (up in file, down in file, up to parent directory, etc) but lose points/seconds the more of the code you view.
Thanks! Displaying the file path is a good idea. We just need to be careful not to give away spoilers through the file path.
Too little time to scroll over the list of repositories. It showed me a snippet with Python code for some observability tool, with

    SELECT count() ...
query, so I know that it uses ClickHouse. The right answer was Sentry, but I didn't have enough time to find it in the drop-down list.
Hey, if any hackers out there have feedback (or even found bugs), let me know!
One of my quizzes included the copyright header for swift which was a giveaway, another was simply a pair of closing brackets and no other text at all, making it impossible. Overall the other ones that worked when it did work were fun though.
Oh, such cases can ruin the fun of the game. It's best to remove them as much as possible. Thanks for letting me know!
Also please colorize the source code and use Fira code or something snazzy :)
maybe gradual hints should be shown as the counter gets closer to zero?

Hint: Language is Javascript

Hint: Owner is "Facebook"

Hint: Other languages used in the repo include

HTML 2.8% CSS 1.5% C++ 1.0% TypeScript 0.5% CoffeeScript 0.4% Other 0.2%

Thanks! Indeed, giving hints is a good idea. For now, I've made a change to provide hints based on the language and logo. I guess if the owner is revealed, it might become too easy due to the auto-complete UI.
right..the autocomplete UI itself could be a hint..

i was thinking it could be like hangman style..

    _ _ A C T
Honestly way too hard for me to be enjoyable. I really love the peak at the code concept, but I'm unfamiliar with most/all of the projects listed.. I would love a simplified version with less choice..
Thank you for giving it a try! You're right, I might have chosen repositories that I'm familiar with. Themes like Simple version, Web development or Pythonista could be a good idea.
Some of the choices may be too similar. I answered one question with "TensorFlow", which was wrong. The answer was Bert, a set of models for TensorFlow.
Yes, that's a difficult problem. I'll review the data.
Ditto. Guessed Docker but it was Moby.
Scrollbars are typically hidden by default on MacOS. I saw source code that looked like it had to be some MongoDB repo, but only saw the first four options. I was confused for a bit. It also wasn't clear that left/right arrows let you view other parts of the code. I thought it would skip to the next question.
When hovering over an item that item is highlighted in pale lavender for only a moment before the highlight moves to the first entry.
Very cool concept and execution. Love the circular periscope viewport. I think the only thing I would've preferred is to have a smaller set of options for each, where they're all visible, instead of having to scroll through a long list, where I've forgotten some options by the time I get to the bottom. Or just put the whole list off to the side so I can see them all.
I'm happy to receive everyone's feedback! I've implemented some easy improvements. I think it has become a bit simpler. The dropdown list UI was hard to see everything, so I changed it to a selection style. I've improved the filter for the code snippets, so it should feel more game-like now.
Be nice if the dropdown guess box of several dozen options was at least sorted alphabetically.
Got 8/10, now I'm happy. It's a great way to explore different repositories and gain familiarity in different projects.
You should exclude unit tests. And the package line from Java files.
doesnt work with Firefox:

    TypeError: e is undefined
    NextJS 11
    [framework-63157d71ad419e09.js:9:69810](https://github-guessr.vercel.app/_next/static/chunks/framework-63157d71ad419e09.js)
Works in my Firefox
cool concept!

the menu and the sudden scroll jump is a bit jarring and answer selection does not reset properly after going to next round?

https://i.imgur.com/UGLmvar.png