general-games alternatives and similar packages
Based on the "Game" category.
Alternatively, view general-games alternatives based on common mentions on social networks and blogs.
-
LambdaHack
Haskell game engine library for roguelike dungeon crawlers; please offer feedback, e.g., after trying out the sample game with the web frontend at -
haskanoid
A free and open source breakout clone in Haskell using SDL and FRP, with Wiimote and Kinect support. -
Allure
Allure of the Stars is a near-future Sci-Fi roguelike and tactical squad combat game written in Haskell; please offer feedback, e.g., after trying out the web frontend version at -
FunGEn
A lightweight, cross-platform, OpenGL-based 2D game engine in Haskell -
falling-turnip
falling sand game with regular parallel arrays. -
chessIO
Fast haskell chess move generator library and console UCI frontend -
halma
Chinese Checkers Haskell library, GUI application and Telegram bot -
gloss-game
A convenience wrapper around the Gloss library to make writing games in Haskell even easier -
werewolf-slack
A chat interface for playing werewolf in Slack -
Ninjas
Haskell game where multiple players attempt to blend in with computer controlled characters while being first to visit the key locations on the board. -
ixshader
A shallow embedding of the OpenGL Shading Language in Haskell -
gore-and-ash
Attempt to build game engine with networking in Haskell using FRP as core idea. -
Liquorice
Haskell embedded domain-specific language (eDSL) for the algorithmic construction of maps for the computer game "Doom" -
battleship
Battleship... Pure.. Functional... Haskell + MongoDB + TypeScript + React... https://battleship-fp.com/ -
netwire-input-glfw
MonadInput instances for GLFW based netwire programs -
postgresql-simple-url
Heroku helpers for pulmurice server
Collect and Analyze Billions of Data Points in Real Time
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of general-games or a related project?
README
general-games
Description
Library providing framework for simulating outcomes of a variety of games, including Poker.
Getting Started
Suppose we want a full deck of standard playing cards:
>>> deck = fullDeck :: [PlayingCard]
>>> deck
[Ace of Clubs,Two of Clubs,Three of Clubs,Four of Clubs,Five of Clubs,Six of Clubs,Seven of Clubs,Eight of Clubs,Nine of Clubs,Ten of Clubs,Jack of Clubs,Queen of Clubs,King of Clubs,Ace of Diamonds,Two of Diamonds,Three of Diamonds,Four of Diamonds,Five of Diamonds,Six of Diamonds,Seven of Diamonds,Eight of Diamonds,Nine of Diamonds,Ten of Diamonds,Jack of Diamonds,Queen of Diamonds,King of Diamonds,Ace of Hearts,Two of Hearts,Three of Hearts,Four of Hearts,Five of Hearts,Six of Hearts,Seven of Hearts,Eight of Hearts,Nine of Hearts,Ten of Hearts,Jack of Hearts,Queen of Hearts,King of Hearts,Ace of Spades,Two of Spades,Three of Spades,Four of Spades,Five of Spades,Six of Spades,Seven of Spades,Eight of Spades,Nine of Spades,Ten of Spades,Jack of Spades,Queen of Spades,King of Spades]
That's nice, but it might better to have a shuffled deck (your results will vary depending on the state of your RNG):
>>> shuffledDeck <- evalRandIO $ shuffle deck
>>> shuffledDeck
[Eight of Spades,Nine of Diamonds,Six of Diamonds,Jack of Diamonds,Ten of Spades,Six of Spades,Seven of Hearts,Four of Hearts,Nine of Hearts,Two of Clubs,Ace of Spades,Queen of Diamonds,Ace of Hearts,Eight of Clubs,Four of Spades,Eight of Hearts,Two of Diamonds,Seven of Clubs,Queen of Spades,Ace of Diamonds,Six of Clubs,Ace of Clubs,Three of Diamonds,Five of Diamonds,Queen of Hearts,Four of Clubs,Five of Spades,Ten of Hearts,Five of Clubs,Three of Spades,Three of Hearts,Two of Spades,Jack of Hearts,Six of Hearts,Five of Hearts,Eight of Diamonds,Three of Clubs,Seven of Spades,Ten of Clubs,Ten of Diamonds,King of Hearts,Two of Hearts,King of Diamonds,Seven of Diamonds,Queen of Clubs,Four of Diamonds,Nine of Clubs,Jack of Spades,King of Clubs,Jack of Clubs,Nine of Spades,King of Spades]
Suppose we want to draw some cards from our newly shuffled deck. There are a variety of ways that we can do this:
--- This will give us all poker hands in a list.
>>> allPokerHands = choose 5 shuffledDeck
--- Do we really have all poker hands?
>>> length allPokerHands
2598960 --- That seems right.
--- We can draw a poker hand by taking the head of the list.
>>> head allPokerHands
[Six of Diamonds,Four of Clubs,Two of Spades,Ten of Clubs,Eight of Hearts]
--- Walking through the list will enumerate every combination of poker hand.
>>> take 5 allPokerHands
[[Six of Diamonds,Four of Clubs,Two of Spades,Ten of Clubs,Eight of Hearts],[Six of Diamonds,Four of Clubs,Two of Spades,Ten of Clubs,Ace of Hearts],[Six of Diamonds,Four of Clubs,Two of Spades,Ten of Clubs,Queen of Spades],[Six of Diamonds,Four of Clubs,Two of Spades,Ten of Clubs,Eight of Diamonds],[Six of Diamonds,Four of Clubs,Two of Spades,Ten of Clubs,Nine of Clubs]]
--- It's useful to be able to draw hands from a shuffled deck.
>>> draw1_ 5 shuffledDeck
Just [Six of Diamonds,Four of Clubs,Two of Spades,Ten of Clubs,Eight of Hearts]
--- Often we might want the remainder of the deck as well.
>>> draw1 5 shuffledDeck
Just ([Six of Diamonds,Four of Clubs,Two of Spades,Ten of Clubs,Eight of Hearts],[Ace of Hearts,Queen of Spades,Eight of Diamonds,Nine of Clubs,King of Diamonds,Four of Diamonds,Jack of Hearts,King of Spades,Ten of Hearts,Two of Hearts,Ten of Spades,Seven of Hearts,Ten of Diamonds,Five of Clubs,Queen of Diamonds,Three of Hearts,Six of Hearts,Three of Diamonds,Eight of Clubs,Seven of Clubs,Queen of Clubs,Four of Hearts,Jack of Diamonds,Seven of Diamonds,Ace of Clubs,Nine of Spades,Four of Spades,Three of Clubs,Ace of Spades,Jack of Spades,Queen of Hearts,King of Clubs,Two of Clubs,King of Hearts,Ace of Diamonds,Nine of Hearts,Six of Clubs,Jack of Clubs,Seven of Spades,Eight of Spades,Six of Spades,Three of Spades,Five of Spades,Two of Diamonds,Five of Hearts,Five of Diamonds,Nine of Diamonds])
--- We can draw multiple hands, of multiple sizes, from a deck at once.
--- A common scenario might be to draw hands for heads-up Texas Hold'em
--- along with all of the community cards, and the remainder of the deck.
>>> draw [5,2,2] shuffledDeck
Just ([[Six of Diamonds,Four of Clubs,Two of Spades,Ten of Clubs,Eight of Hearts],[Ace of Hearts,Queen of Spades],[Eight of Diamonds,Nine of Clubs]],[King of Diamonds,Four of Diamonds,Jack of Hearts,King of Spades,Ten of Hearts,Two of Hearts,Ten of Spades,Seven of Hearts,Ten of Diamonds,Five of Clubs,Queen of Diamonds,Three of Hearts,Six of Hearts,Three of Diamonds,Eight of Clubs,Seven of Clubs,Queen of Clubs,Four of Hearts,Jack of Diamonds,Seven of Diamonds,Ace of Clubs,Nine of Spades,Four of Spades,Three of Clubs,Ace of Spades,Jack of Spades,Queen of Hearts,King of Clubs,Two of Clubs,King of Hearts,Ace of Diamonds,Nine of Hearts,Six of Clubs,Jack of Clubs,Seven of Spades,Eight of Spades,Six of Spades,Three of Spades,Five of Spades,Two of Diamonds,Five of Hearts,Five of Diamonds,Nine of Diamonds])
Contribute
For any problems, comments, or feedback please create an issue here on GitHub.
License
general-games
is released under the MIT License, and Copyright 2017 Christopher A. Gorski.
*Note that all licence references and agreements mentioned in the general-games README section above
are relevant to that project's source code only.