This repository has been archived by the owner on Apr 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
a
- Loading branch information
Showing
17 changed files
with
1,699 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
.eunit | ||
deps | ||
priv | ||
*.o | ||
*.beam | ||
*.plt | ||
*.plt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,41 @@ | ||
chessms | ||
======= | ||
ChesSMS is an application that lets you play Chess over SMS, powered by | ||
[Twilio](http://www.twilio.com/). | ||
|
||
Play Chess over SMS! | ||
|
||
## Dependencies | ||
Erlang/OTP R15B01 (may work on older versions) | ||
|
||
## Building | ||
|
||
ChesSMS uses [rebar](https://github.com/basho/rebar). To build it... | ||
|
||
./rebar get-deps | ||
./rebar compile | ||
|
||
## Choosing a Chess Engine | ||
ChesSMS should in theory work with any UCI compatible chess engine. It is known to | ||
work with [Stockfish](https://github.com/mcostalba/Stockfish). | ||
|
||
If using stockfish, compile it according to your machine and copy the | ||
binary to `priv/bin/stockfish`. | ||
|
||
If using another Chess Engine, you can put the binary where ever you want | ||
but you'll have to modify `src/chessms_server.app.src` and change the | ||
`engine_path` configuration parameter. | ||
|
||
## Running | ||
If everything has been built correctly, you should be able to run: | ||
|
||
erl -pa ebin deps/*/ebin -s chessms_server -chessms_server port 7000 | ||
|
||
## Connecting to SMS | ||
To connect ChesSMS to an SMS enabled Twilio number, sign up for Twilio | ||
and buy a number (if you haven't already). Configure the SMS URL of the | ||
phone number to point where your ChesSMS server is running. | ||
|
||
Now, you should be able to text "play" to your Twilio phone number to | ||
start a chess game! | ||
|
||
## Contributing | ||
Contributions are welcome. If you're looking for things to add, checkout | ||
the Issues page. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{application,chessms_server, | ||
[{description,"HTTP Server for ChesSMS"}, | ||
{vsn,"0.0.1"}, | ||
{modules, | ||
[chessboard,chessms_engine_pool,chessms_game,chessms_game_sup, | ||
chessms_handler,chessms_server,chessms_server_sup,chessms_store, | ||
uci_worker]}, | ||
{registered,[chessms_server]}, | ||
{applications,[kernel,stdlib,xmerl,cowboy]}, | ||
{mod,{chessms_server,[]}}, | ||
{env, | ||
[{pools, | ||
[{engine_pool, | ||
[{size,5},{max_overflow,15}], | ||
[{engine_path,"priv/bin/stockfish-linux"}]}]}]}]}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
% move these records to an hrl file later | ||
|
||
-type chesspiece() :: pawn | bishop | knight | rook | queen | king. | ||
-type chesscolor() :: white | black. | ||
-type chessmove_special() :: normal | castle | promotion | enpassant. | ||
-type chesssquare() :: 1..64. | ||
|
||
-define(STARTPOS_FEN, "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"). | ||
|
||
-record(castling_rights, { | ||
white_kingside = true :: boolean(), | ||
white_queenside = true :: boolean(), | ||
black_kingside = true :: boolean(), | ||
black_queenside = true :: boolean() | ||
}). | ||
|
||
-record(chessboard, { | ||
placements :: tuple(), | ||
active = white :: chesscolor(), | ||
castling = #castling_rights{} :: tuple(), | ||
enpassant = none :: chesssquare() | none, | ||
halfmove_clock = 0 :: pos_integer(), | ||
fullmove_number = 1 :: pos_integer() | ||
}). | ||
-record(chessmove, { | ||
side :: chesscolor(), | ||
chesspiece :: chesspiece(), | ||
from :: chesssquare(), | ||
to :: chesssquare(), | ||
special :: chessmove_special(), | ||
capture = false :: boolean(), | ||
promotion = undefined :: chesspiece() | undefined | ||
}). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ChesSMS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
%%-*- mode: erlang -*- | ||
{deps, [ | ||
{cowboy, ".*", {git, "git://github.com/extend/cowboy.git", "5525369a4a98ff57f157842106f4adbbe1514d1b"}}, | ||
{poolboy, ".*", {git, "git://github.com/devinus/poolboy.git", "fc8312d0f77bb16557030b65803fe81320e51c78"}}, | ||
{mimetypes, ".*", {git, "git://github.com/spawngrid/mimetypes.git", "0.9"}} | ||
]}. | ||
{sub_dirs, ["rel"]}. | ||
{cover_enabled, true}. |
Oops, something went wrong.