Skip to content

derektmueller/morra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

morra

Command line game of morra (https://en.wikipedia.org/wiki/Morra_(game)) implemented in haskell as part of a monad transformers exercise in Haskell Book (http://haskellbook.com/). Includes PvP, PvC, and CvC (computer versus computer!) game modes.

Build & Run

make
make run

Example Output

Please select a mode:
PVP (1)
PVC (2)
CVC (3)
3
AI Player 1 showed 0 and guessed 5.
AI Player 2 showed 2 and guessed 1.
Nobody guessed correctly.
Score:
Player 1: 0
Player 2: 0
AI Player 1 showed 1 and guessed 0.
AI Player 2 showed 2 and guessed 0.
Nobody guessed correctly.
Score:
Player 1: 0
Player 2: 0
AI Player 1 showed 2 and guessed 4.
AI Player 2 showed 1 and guessed 0.
Nobody guessed correctly.
Score:
Player 1: 0
Player 2: 0
AI Player 1 showed 4 and guessed 1.
AI Player 2 showed 4 and guessed 5.
Nobody guessed correctly.
Score:
Player 1: 0
Player 2: 0
AI Player 1 showed 2 and guessed 3.
AI Player 2 showed 2 and guessed 1.
Nobody guessed correctly.
Score:
Player 1: 0
Player 2: 0
AI Player 1 showed 1 and guessed 1.
AI Player 2 showed 5 and guessed 2.
Nobody guessed correctly.
Score:
Player 1: 0
Player 2: 0
AI Player 1 showed 4 and guessed 5.
AI Player 2 showed 0 and guessed 1.
Nobody guessed correctly.
Score:
Player 1: 0
Player 2: 0
AI Player 1 showed 4 and guessed 4.
AI Player 2 showed 0 and guessed 3.
AI Player 1 guessed correctly.
Score:
Player 1: 1
Player 2: 0
AI Player 1 showed 2 and guessed 3.
AI Player 2 showed 1 and guessed 3.
Both players guessed correctly. No points awarded.
Score:
Player 1: 1
Player 2: 0
AI Player 1 showed 5 and guessed 1.
AI Player 2 showed 1 and guessed 0.
Nobody guessed correctly.
Score:
Player 1: 1
Player 2: 0
AI Player 1 showed 0 and guessed 4.
AI Player 2 showed 1 and guessed 1.
AI Player 2 guessed correctly.
Score:
Player 1: 1
Player 2: 1
AI Player 1 showed 4 and guessed 2.
AI Player 2 showed 0 and guessed 0.
Nobody guessed correctly.
Score:
Player 1: 1
Player 2: 1
AI Player 1 showed 3 and guessed 4.
AI Player 2 showed 1 and guessed 2.
AI Player 1 guessed correctly.
Score:
Player 1: 2
Player 2: 1
AI Player 1 showed 3 and guessed 0.
AI Player 2 showed 1 and guessed 4.
AI Player 2 guessed correctly.
Score:
Player 1: 2
Player 2: 2
AI Player 1 showed 0 and guessed 1.
AI Player 2 showed 1 and guessed 5.
AI Player 1 guessed correctly.
Player 1 wins.

Releases

No releases published

Packages

No packages published