shokri-navid / bet-board

Coding challenge for Raw Innovention

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bet Board

This project simulate a slot bet machine which has multiple rows and directions for its pay lines.

This project is written with lumen framework.

Component

IGame:

This interface provides a frame for all slot machines that can be simulated in this application, It makes possible to create more different slot board with different rules and structures without changing the other layers.

IBoardCalculator:

This interface provides a frame to create more diverse calculation rule for every slot machine.

Bet Session

This class simulate a betting attempt by the machine. it can be done by any machine that implement the IGame interface.

SimpleSlotGame

This class simulate a 5*3 slot machine with horizontal lines and 'W' and 'M' shaped pay lines by implementing IGame interface.

SimpleSlotCalculator

This class implements the IBoardCalculator to provide this rules:

3 cards chain --> 0.2
4 card chain --> 2
4 card chain --> 10

Slot Command

This class add an artisan command to the application to run the slot machine once. you can run machine by this command:

php artisan slot

Enjoy your time :)

About

Coding challenge for Raw Innovention


Languages

Language:PHP 98.6%Language:Shell 1.4%