https://github.com/code-game-project/number-guessing
A number guessing game.
https://github.com/code-game-project/number-guessing
beginner game go number-guessing
Last synced: 5 months ago
JSON representation
A number guessing game.
- Host: GitHub
- URL: https://github.com/code-game-project/number-guessing
- Owner: code-game-project
- License: agpl-3.0
- Created: 2022-08-09T16:21:12.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-04-13T05:46:57.000Z (about 3 years ago)
- Last Synced: 2024-06-19T16:45:28.181Z (about 2 years ago)
- Topics: beginner, game, go, number-guessing
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Number Guessing


A number guessing game.
## Known instances
- `games.code-game.org/number-guessing`
## Usage
```sh
# Run on default port 8080
number-guessing
# Specify a custom port
number-guessing --port=5000
## Specify a custom port through an environment variable
CG_PORT=5000 number-guessing
```
### Running with Docker
Prerequisites:
- [Docker](https://docker.com/)
```sh
# Download image
docker pull codegameproject/number-guessing:0.1
# Run container
docker run -d --restart on-failure -p :8080 --name number-guessing codegameproject/number-guessing:0.1
```
## Event flow
1. Send the `guess` command to make a guess.
2. Receive either the `too_high`, the `too_low` or the `correct` event.
## Building
### Prerequisites
- [Go](https://go.dev) 1.18+
```sh
git clone https://github.com/code-game-project/number-guessing.git
cd number-guessing
go build .
```
## License
Copyright (C) 2022-2023 Julian Hofmann
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .