https://github.com/altenwald/leprechaun
Leprechaun Game wrote in Elixir
https://github.com/altenwald/leprechaun
elixir elixir-game game shell-game
Last synced: 7 months ago
JSON representation
Leprechaun Game wrote in Elixir
- Host: GitHub
- URL: https://github.com/altenwald/leprechaun
- Owner: altenwald
- Created: 2019-04-07T21:06:08.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-11-03T10:17:16.000Z (about 2 years ago)
- Last Synced: 2024-05-01T11:37:46.444Z (over 1 year ago)
- Topics: elixir, elixir-game, game, shell-game
- Language: Elixir
- Size: 59.1 MB
- Stars: 12
- Watchers: 5
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# Leprechaun

Leprechaun is a game based on [Gems of War](https://gemsofwar.com/), the [Threasure Hunt](https://gemsofwar.zendesk.com/hc/en-us/articles/205368765-Treasure-Hunt-and-Treasure-Maps).
The base of the game is swap pieces, only one each time and only with the ones in north, south, east or west of the source one. The combinations should be made by 3 or more in vertical or horizontal way. If you achieve to match 4 then you won't loose a turn and if you achieve match more than 4 then you'll obtain an extra turn. The game starts with 10 turns and ends when you run out of turns.
If you love this content and want we can generate more, you can support us:
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RC5F8STDA6AXE)
## Checking code
The source code has implemented different tools to ensure we are arriving to a minimal internal quality, that's because we are working to get the output of this command green:
```
mix check
```
## Installation
It's easy to install. You only needs to have [Elixir](https://elixir-lang.org/install.html) installed and run this to obtain the code:
```
git clone git@github.com:altenwald/leprechaun.git
```
Because we use [Ecto](https://hexdocs.pm/ecto/Ecto.html) and [Mnesia](https://en.wikipedia.org/wiki/Mnesia) to store the high scores you'll need to run these tasks before:
```
mix do ecto.create, ecto.migrate
```
Then you can see there are a new directory in that path called `leprechaun`. You can go inside using the terminal and write:
```
iex -S mix run
```
The Elixir shell will be running after the compilation. You can start the game using this command:
```elixir
Leprechaun.Console.run :mygame
```
Follow the instructions and enjoy!
### Web Interface
Version 0.2 has a new addition and it's [cowboy][1] and [jason][2] among others to provide an HTTP
interface to let us to play via web.
Version 1.0 has been a rewrite of the website using [Phaser3][3]
[](screenshot_web.png)
You only need to run the project as showed above (in the previous section) and then access via this link:
http://localhost:4012
You can change the configuration to listen in another port and even to use IPv6 instead.
Enjoy!
[1]: https://github.com/ninenines/cowboy
[2]: https://github.com/michalmuskala/jason
[3]: https://phaser.io/