GithubHelp home page GithubHelp logo

thilaire / codinggameserver-olddonotuse Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 2.0 6.64 MB

a framework to create Coding Game (socket-based server, client and web server)

License: GNU General Public License v3.0

C 22.47% Python 51.20% HTML 9.85% CSS 7.82% Shell 0.18% Makefile 0.52% TeX 7.95%
coding-game programming contest-platform

codinggameserver-olddonotuse's Introduction

CodingGameServer

CodingGameServer (CGS) is a framework to create some Coding Games.

What do you call Coding Game ?

To involve our (undergraduate) students into their programming lecture (mainly C), we gave them the opportunity to show their skills in a programming contest based on a game, different every year. The game considered are mainly turn-based, two players games, like the chess, othelo or checkers (not necesseraly a zero-sum games, but it could). Our students have to write a program, based on a simple API, to play that game agains other students (or against some training players). For that, they need to use what they learn in class, and code some algorithms, like min-max, A*, etc.

So, what is CodingGameServer ?

CGS is a (simple) framework to create such a contest. To play the games, we need:

  • a server that the players, and mainly all the game (synchronize the players, create the games, play the games from the players move, define the game rules, etc.)
  • an API used to write the player programs (this API provides functions to connect to the server, get back the data from the game, send a move or get the move of the opponent, etc.)
  • optionally, a web-server to interact with the server and manage the tournaments, display the games, etc.

So, CGS provides a (complete) framework to set up such a server (and web-server), with dedicated API. For the moment, it is supplied with only one game (Labyrinth), but it has been design in order to ease the writing for a new game (you will have only to write code to manage the rules of your game and to display it).

How to run it ?

Before using it for your own game, the 1st thing is to try it with the Labyrinth game. You need:

  • Python 3.4+
  • the following packages: colorama, colorlog, docopt, bottle, jinja2, ansi2html, karellen-geventws. Type pip install colorama colorlog docopt bottle jinja2 ansi2html karellen-geventws to install them.

Finally, to run it:

./runCGS.py Labyrinth --dev

It will run the TCP server on port 1234, and the webserver on port 8088 (you can change those port on command-line, see the help with ./runCGS --help). Note that the --dev option is to run it in dev mode (ie do some logging in games/Labyrinth/logs/ to know what's going on) Remark: this have only been tested on Unix-based OS (only on Linux and Mac OS), but it should work on Windows (...or not...)

You can connect to the webserver (by opening the webpage http://localhost:8088 ) and check how ugly our webpages are for the moment (the functionality are present, so in fact we just need to write some fancy templates instead of the ugly ones...).

Then, you can connect your player to make it play.... Wait, you need to write your own player, for that...

Ok, you can use the API provided (see games/Labyrinth/API/LabyrinthAPI.h) to connect to the server, wait for a game, and then play an intense game ! It's your turn to code !! (or you can directly have a look at the different simple programs we wrote as a tutorial for Labyrinth in folder games/Labyrinth/src/, as a basis to start)

codinggameserver-olddonotuse's People

Contributors

brajard avatar minapecheux avatar thilaire avatar

Watchers

 avatar  avatar  avatar

codinggameserver-olddonotuse's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.