Git Product home page Git Product logo

fiar's Introduction

fiar

Four in a Row - A game to learn Erlang

Contact Us

For questions or general comments regarding the use of this library, please use our public hipchat room.

If you find any bugs or have a problem while using this library, please open an issue in this repo (or a pull request :)).

And you can check all of our open-source projects at inaka.github.io

The Game

Connect Four is a two-player connection game in which the players first choose a color and then take turns dropping colored discs from the top into a seven-column, seven-row vertically suspended grid. The pieces fall straight down, occupying the next available space within the column. The object of the game is to connect four of one's own discs of the same color next to each other vertically, horizontally, or diagonally before your opponent.

http://en.wikipedia.org/wiki/Connect_Four

Purpose

This is a project oriented to learning the erlang language, in fiar you will find topics such as:

Stages of the project

For a procedural learning, fiar is divided into small and separate issues, grouped by iterations.

  • Iteration 1: learn the basic estructure of an erlang application, tests, process as a gen_server, and supervisor with the simple_one_for_one strategy.

  • Iteracion 2: create the fiar application module, README.md and conecting to MySQL with sumo_db.

  • Iteration 3: Provide a RESTful API to let users play, adding a basic authentication.

  • Iteration 4: Add SSE support and create a basic website with standard SSE support to let users play the game using already existing RESTful API.

How to use

Basic usage:

fiar:start().
ok

Match = fiar:start_match().
<0.163.0>

fiar:play(Match, Col).
next

play is called to make a move, and it is expected to return the atom won when the player won, drawn when de board is full and none won, and next when it is the next player's turn.

Example to vertically won:

fiar:start().
ok

Match = fiar:start_match().
<0.163.0>

fiar:play(Match, 1).
next

fiar:play(Match, 2).
next

fiar:play(Match, 1).
next

fiar:play(Match, 2).
next

fiar:play(Match, 1).
next

fiar:play(Match, 2).
next

fiar:play(Match, 1).
won

Run tests

Every module has its your own test file created with Common Test And you can run the whole suite with:

make devtests

Dependencies

Documentation

fiar's People

Contributors

euen avatar elbrujohalcon avatar alemata avatar spike886 avatar benhsu avatar hernanrivasacosta avatar

Watchers

James Cloos 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.