Giter VIP home page Giter VIP logo

haskell-nm-9morris's Introduction

Nine mens morris in Haskell

author: Felix Moessbauer maintainer: [email protected]

Description

Implementation of a nine men morris ai that communicates with the LMU NMN gameserver and handles all specified protocol cases. This implementation fullfills all usefull specifications given here: http://www.nm.ifi.lmu.de/teaching/Praktika/2014ws/sysprak/

After the build, start a game here and start the binary with the corresponding gameid and the playernumber.

Build with cabal

The easiest way to build the client is to call 'cabal build' in the current directory. This builds the binaries with default flags. After building, binary files are in the dist folder.

Other possible flags are:

- debug         enables debug messages and increases verbosity
- functionalai  use the simple test ai instead of the clever one

Example:

cabal configure --flags="debug"
cabal configure --flags="debug functionalai"

Run with cabal

Call cabal run to start the client. If no or wrong arguments are passed to the program, it shows a help message. To start the client with arguments the best way is to do it this way: cabal run -- arg1 arg2 ... The double dash is to seperate flags sent to cabal and program arguments. If you want to send flags to cabal, place these between 'run' and the double dash: cabal run -v -- arg1 arg2 ...

Test with cabal

Call cabal test to test the AI integrity. If you get a cabal prelude: no parse error, try to remove all test reports and delete the dist directory. This is a cabal bug :(

Build with stack

You can easily build this client with stack too. It currently supports the latest snapshot lts-7.7 and ghc-8.0.1. If you want to specify an older snapshot, just modify it in the stack.yaml file. (No tests for previous versions yet)

$ git clone https://github.com/fmoessbauer/haskell-nm-9morris
$ cd haskell-nm-9morris/
$ stack build

Or with flags:

$ git clone https://github.com/fmoessbauer/haskell-nm-9morris
$ cd haskell-nm-9morris/
$ stack build --flags haskell-nm-9morris:debug

Run with stack

$ cd haskell-nm-9morris/
$ stack exec -- haskell-nm-9morris <gameid> config.ini <playernr>

Test with stack

$ cd haskell-nm-9morris/ && stack test

Profiling

If you want to profile, you need to install the profiling version of all libraries. See https://nikita-volkov.github.io/profiling-cabal-projects/ for more information

Common mistakes

cabal-install fails because the profiling versions of the libaries are not installed: If you do not need profiling, delete or rename the file cabal.config. Otherwise you have to install the profiling versions with the reinstall command. See Profiling

No Connection

Be aware, the gameserver is only accessable inside the MWN (Münchner Wissenschaftsnetz). If the client cannot connect, check your VPN Connection

Connection gets interrupted

If your internet connection is very slow or has a high latency time, the server might close the connection in the think phase, because it does not get a response in the expected time window. To check this problem ping the gameserver and check the round trip time.

If you cannot fix this problem, increase the aiTimeoutBuffer set in Globals.hs

haskell-nm-9morris's People

Contributors

cirquit avatar fmoessbauer avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

cirquit

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.