Skip to content
This repository has been archived by the owner on Mar 3, 2025. It is now read-only.

Word Scramble is a cli game that lets you guess the word that is scrambled.

License

Notifications You must be signed in to change notification settings

MementoMori11723/Word-Scramble

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Word Scramble

Welcome to Word Scramble, a simple yet fun game where you test your word-guessing skills! The game randomly selects a word, scrambles its letters, and challenges you to guess the correct word within three attempts.

Features

  • Play directly in the command-line interface (CLI).
  • Option to run a web server to play via a web browser.
  • Configure the web server port using command-line arguments.

How to Play

CLI Mode (Default)

Simply run the game without any flags to start playing in the terminal:

$ ./word-scramble

The game will display a scrambled word, and you'll have three chances to guess the correct word.

Web Mode

To start the web server, use the -web flag:

$ ./word-scramble -web

Custom Port

By default, the server runs on port 8080. You can specify a custom port using the -port flag:

$ ./word-scramble -web -port 9090

Then, visit http://localhost:9090 to play.

Command-Line Arguments

  • -web: Starts the web server for the game.
  • -port <number>: Specifies the port for the web server.

Example Game Flow

CLI

  1. The game displays a scrambled word: elppa
  2. You guess: apple
  3. If correct, the game congratulates you. If incorrect, you have up to 3 attempts.

Web

  1. Open the web page.
  2. Enter your guesses in the provided input box.
  3. Get instant feedback on your guesses.

Installation

Make sure you have Go installed on your system. Build the game with:

go build -o word-scramble

Alternatively, you can download the pre-built packages from the GitHub Releases page.

Development

If you want to contribute or modify the code:

  1. Clone the repository.
  2. Make changes and test them.
  3. Submit a pull request if you're contributing.

License

This project is open-source and available under the MIT License.

Enjoy the game and happy scrambling!