README
ΒΆ
Idiom Chain Master π
Welcome to the Idiom Chain Master! This Go-based game takes the classic word chain game to the next level, utilizing the richness of Chinese idioms. Dive into the linguistic beauty and challenge yourself with chains of idioms!
π― Objective
The game's goal is simple yet challenging: to create a chain of Chinese idioms, starting where the last idiom ended. Each player's input must start with the last character of the previous idiom, making each round a brain-teasing adventure.
β¨ Features
- Dictionary Integration: Leverages an extensive dictionary of four-character Chinese idioms stored in a
.txtfile. - Smart Start: Game initiation requires a valid idiom from the dictionary, ensuring every game kicks off on the right note.
- Chain Mechanism: The game checks the last character of the previous idiom and expects the next one to start with the same character. If direct character matching fails, it falls back to phonetic (Pinyin without tones) matching, adding a layer of complexity and learning.
- Scoring System: Points are awarded for successful chaining, with penalties for repetition or failure, keeping players on their toes.
- Hints on Demand: Stuck? Use the
tipcommand to get a suggestion for your next move, though it comes with a slight score penalty. - Graceful Exit: Players can end the game anytime with the
quitcommand, triggering a final score calculation based on performance and efficiency.
π How to Play
- Clone the repository to your local machine.
- Ensure you have Go installed and your GOPATH set up correctly.
- Run the game using
go run .from the project directory. - Follow the on-screen prompts to start chaining idioms!
π Implemented Features
- Reading and parsing idioms from a
.txtfile. - Basic game loop accepting user inputs.
- Scoring system based on successful chains, repetitions, and failures.
-
tipcommand for getting suggestions with a minor score penalty. -
quitcommand for ending the game and calculating the final score.
π οΈ Tech Stack
- Language: Go (Golang)
- External Libraries:
github.com/mozillazg/go-pinyinfor converting Chinese characters to Pinyin, aiding the phonetic fallback mechanism.
π¦ Installation
- Clone this repository.
- Navigate to the cloned directory.
- Run
go buildto compile the game. - Start the game with
./idiom-chain-master(oridiom-chain-master.exeon Windows).
π Future Enhancements
- Improved phonetic matching to handle tones and multiple pronunciations.
- Enhanced AI for generating
tipsuggestions, potentially using machine learning to predict harder chains. - Multiplayer support for online challenges.
- GUI for a more interactive experience.
π A Friendly Nudge
For those intrigued by language games and programming, take a look at a similar project in Rust: Idiom Solitaire. While not fully fleshed out, it holds promise and awaits your contributions and curiosity.
π License
This project is open-sourced under the Apache License Version 2.0. Feel free to fork, modify, and use it in your projects. Contributions and suggestions are welcome!
π Contributing
Your contributions are what make the Idiom Chain Master better. Any contributions you make are greatly appreciated. Check out our contribution guidelines for more information.
π Reference
This project uses the go-pinyin library for handling Pinyin conversion, licensed under MIT.
Embark on a journey of words, wisdom, and wit with Idiom Chain Master. Let the chain begin!
Documentation
ΒΆ
There is no documentation for this package.