#cli #game #cli-game #fun

app guess-that-lang

CLI game to see how fast you can guess the language of a code block!

20 stable releases

1.0.20 Aug 22, 2022
1.0.19 Aug 21, 2022

#63 in Games

Download history 4/week @ 2023-10-17 9/week @ 2023-10-24 33/week @ 2023-10-31 23/week @ 2023-11-14 21/week @ 2023-11-21 62/week @ 2023-11-28 20/week @ 2023-12-05 4/week @ 2023-12-12 20/week @ 2023-12-19 40/week @ 2023-12-26 3/week @ 2024-01-02 21/week @ 2024-01-09 9/week @ 2024-01-23 60/week @ 2024-01-30

90 downloads per month

Apache-2.0 and LGPL-3.0-or-later

435KB
1K SLoC

Guess That Lang!

Share Your High Score

CLI game to see how fast you can guess the language of a code block!

If you like the game, please consider giving a ⭐!

Game Demo

Code is retrieved from either random repos or random gists on GitHub using any of the top 24* most popular languages from the Stack Overflow 2022 Developer Survey. *VBA is replaced with Dockerfile

The code is then processed in a number of ways to make the experience more enjoyable.

Installation

Using Prebuilt Binaries
  • With Bash
    curl -fsSL "https://bina.egoist.dev/Lioness100/guess-that-lang" | sh
    

    Using Bina

  • Manual Installation

    Prebuilt binaries are available for Windows, Linux, and macOS and can be found attached to the latest release.

Building From Source

⚠️ Rust 1.63.0 or higher is required to build. Rust can be updated with rustup update.

Install Rust and then run:

cargo install guess-that-lang

Usage

It's strongly recommended to provide a Github personal access token. This will allow the game to make more Github requests before getting ratelimited. Click here to make one (no scopes are required).

⚠️ Resizing the terminal window while playing will cause the game to go a bit wonky.

# Tokens will be stored in a config file so you only need to input them once.
guess-that-lang --token "XXX" # or -t

# Get code from gists rather than repos.
# Repos generally provide better code quality, but gists require less API calls.
guess-that-lang --provider gists # or -p

# Wait 5 seconds after showing the options before starting to reveal code. (Default: 1500)
guess-that-lang --wait 5000 # or -w

# Reveal lines in random order instead of top to bottom. (Default: false)
guess-that-lang --shuffle # or -s

# Theme overrides will be stored in a config file so you only need to input them once.
guess-that-lang --theme dark
guess-that-lang --theme light

Acknowledgements

This game takes heavy inspiration from both guessthiscode and stripcode.

Contributing

I'm a beginner at Rust, so if you see any code that can be improved or have any general ideas, please let me know! Feel free to open an issue or a pull request.

Dependencies

~11–22MB
~354K SLoC