Home

Awesome

ten by ten

what is this

I'm programming a clone of the popular mobile game 1010!

<!-- * [server stats](http://rawgit.com/JosePedroDias/tenbyten/master/stats.html) -->

roadmap


resources

assets:

<!--* [Press Start 2P font](http://www.dafont.com/pt/press-start-2p.font) by [codeman38](http://www.zone38.net/font/)-->

client-side libs:

server-side modules:


server-side highscores

game session state consists of:
- id    (session id)
- m     (10x10 of bool, initially false)
- slots (int[3], random pieceIdx, each can be false if empty)
- step  (int, initially 0)
- score (int, initially 0)
- ended (bool, initially false)

endpoints:

/new-game
creates new game session, returning it
<gameSessionState> (always)


/play/<sessionId:string>/<step:int>/<slotIndex:int>/<x:int>/<y:int>
attempts to play the given command and returns updated state
{err:'invalid arguments'} (if malformed params)    
{err:'inactive session'}  (if session does not exist)
{err:'finished game'}     (if session already ended)
{err:'no piece found'}    (if slot has no piece)
{err:'piece did not fit'} (if piece does not fit matrix)


/highscore/<sessionId:string>/<email:string>/<name:string>
converts an ended state into a high score (email is to use gravatar avatar)
{score:<int>, rank:<int>} (regular scenario)
{err:'inactive session'}  (if session does not exist)
{err:'unfinished game'}   (if session hasn't ended)


/highscores
returns array of ordered high scores
{err:null, results:[{name:<string>, email:<string>, score:<int>}]}


/get/<sessionId:string>
for debugging purposes. sends current state, with matrix


/active-sessions
for debugging purposes. returns array of active sessions