Skip to content

Commit 2258efb

Browse files
committedFeb 23, 2016
add application interface
1 parent 6845d4a commit 2258efb

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
 

‎app.rb

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
require 'sinatra'
2+
3+
# start a new game
4+
get '/new_game' do
5+
game = Game.new # returns the game_id
6+
end
7+
8+
#join game
9+
get '/join/:game_id' do
10+
game = # find game by :game_id
11+
game.add_player # todo
12+
end
13+
14+
# make a move
15+
get '/play/:game_id/:move' do
16+
game = # find game by :game_id
17+
game.board.insert_into_column(:move)
18+
end

0 commit comments

Comments
 (0)
Please sign in to comment.