Skip to content

miciek/free-prisoners

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 

Free Prisoners

An application built on top of Free Monad in Cats. It shows how Free can be used to create pure DSLs, side-effecting interpreters and how to use those things together.

The example implements a way to play Prisoner's Dilemma in several modes:

Running local games

  1. sbt "runMain com.michalplachta.freeprisoners.apps.HotSeatGame" - to run Hot Seat Game.
  2. sbt "runMain com.michalplachta.freeprisoners.apps.SinglePlayerGame" - to run Single Player Game.

Running Multiplayer Game with the Remote Server

RemoteServerInterpreter uses Akka Remoting (codename Artery).

To run Multiplayer Game you will need three separate sbt sessions:

  1. BIND_PORT=2552 sbt "runMain com.michalplachta.freeprisoners.apps.MultiplayerServer" - to run the server on specified server port,
  2. sbt "runMain com.michalplachta.freeprisoners.apps.MultiplayerGame" - to run the first player session,
  3. sbt "runMain com.michalplachta.freeprisoners.apps.MultiplayerGame" - to run the second player session.

See application.conf for more details about the configuration of all 3 actor systems.

About

Prisoner's Dilemma game engine implemented using Cats Free Monad and Freestyle

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages