Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Five-in-a-Row online with Haskell and Server-sent Events
Haskell JavaScript
tree: 67f01da0cd

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Tfoo
static
templates
.gitignore
Application.hs
LICENSE
Main.hs
Procfile
README.rdoc
compile.sh
package.json

README.rdoc

Tfoo

About

An implementation of Five in a Row game done in Haskell and Yesod with Server-sent Events.

Demo: tfoo.herokuapp.com

It is based on a previous project of mine, takefive, which is a minimal Five in a Row implementation. If you're new to Haskell and would like to see sample code, inspect takefive’s source code.

Tfoo is an attempt to create simple, modern and useful Haskell web application. It doesn't require any database setup (because it doesn't use database) and its deployment is relatively easy (see: Deploying Tfoo and other Haskell applications to Heroku ). Some people say that it is also an enjoyable game.

Helpful links

Project structure

Tfoo/*.hs          : Most basic, non-IO data and functions.
Tfoo/Handlers/*.hs : Only topmost Handler functions.
Tfoo/Helpers/*.hs  : IO functions built on top of Tfoo/*.hs code; these
                     helper functions are used in Handlers.
Main.hs            : Main entry point.

Dependencies

The project lacks Cabal file. I'll add one in my free time (pull requests welcome too!). Below, for quick reference, a list of all dependencies.

wai-eventsource
yesod
yesod-static
yesod-default
blaze-builder
shakespeare-js
shakespeare-css
hamlet

ToDo

(pull requests welcome)

  • Add cabal file.

  • Improve AI (make it faster; implement minimax).

  • Create a mobile view.

  • Create a (public) dashboard that would show current games (real-time).

  • There is a bug that causes Server-sent Events not being propagated after ~3 minutes of client (Safari browser) waiting. Investigate and fix.

License

MIT, see LICENSE file for details.

Something went wrong with that request. Please try again.