Skip to content

code-game-project/number-guessing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Number Guessing

CodeGame Version CGE Version

A number guessing game.

Known instances

  • games.code-game.org/number-guessing

Usage

# 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:

# Download image
docker pull codegameproject/number-guessing:0.1

# Run container
docker run -d --restart on-failure -p <port-on-host-machine>: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 1.18+
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 https://www.gnu.org/licenses/.