Giter Club home page Giter Club logo

tictactoe's Introduction

tictactoe

Client server TicTacToe Game with additional death match rules

Prototype implementation using ReST

APIs

start
	Description: Initiates a new game
	Method: GET
	Inputs: 
	Response: string gameid
	Example: http://cs2.uco.edu/~gq011/tictactoe/server?controller=api&method=start&boardsize=3

connect
	Description: Joins a player to a game and returns a player id. 
	First player to connect successfully gets the playerid of p1, first to move. 
	Second player to connect successfully gets the playerid of p2, second to move. 
	
	Method: GET
	Inputs: string	gameid
	Response: string playerid
	Example: http://cs2.uco.edu/~gq011/tictactoe/server?controller=api&method=connect&gameid=123ghv1234jb	

status
	Description: Get the status of the game
	Method: GET
	Inputs: string	gameid 
	Response: int 0 = game has not started yet
			  int 1 = player 1's turn
			  int 2 = player 2's turn
			  int 3 = player 1 is winner
			  int 4 = player 2 is winner
	Example: http://cs2.uco.edu/~gq011/tictactoe/server?controller=api&method=status&gameid=123ghv1234jb	
	
mode
	Description: Get the mode of the game
	Method: GET
	Inputs: string	gameid 
	Response: string tictactoe|slide
	Example: http://cs2.uco.edu/~gq011/tictactoe/server?controller=api&method=mode&gameid=123ghv1234jb	
	
move
	Description: place a move
	Method: POST
	Inputs: string	gameid
	string	playerid
	int	position
	Response: true
	Example: http://cs2.uco.edu/~gq011/tictactoe/server?controller=api&method=move&gameid=123ghv1234jb&playerid=2131231&position=0	
	
grid
	Description: fetch the current game grid
	Method: POST
	Inputs: string	gameid
	Response: JSON array
	Example: http://cs2.uco.edu/~gq011/tictactoe/server?controller=api&method=grid&gameid=123ghv1234jb	

	
	
All responses use http code of 200, if an error occurs the response code is set to 400.
In the event of an error you may also get one of the following error messages as a response:

"Unknown Error"
"Database Error"
"Invalid Move/Command"
"You must provide a valid game ID"
"You cant join this game as it is already full"
"That game does not exist"
"You must provide a valid player ID"
"Player is not part of this game"
"Game not started"
"It is not your turn"
"Game is over"

tictactoe's People

Contributors

gabe565 avatar seankelly55 avatar tripledubs avatar

Watchers

 avatar  avatar

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.