Code Monkey home page Code Monkey logo

locknroll's Introduction

WELCOME TO LOCK N' ROLL PYTHON!

Disclaimer: as far as I am aware, Armor Games owns the Lock N' Roll intellectual property. I am not affiliated with this orgnization in any way. None of the code I developed is from the actual game's source code. The real game (here) is much more fun and I'd encourage you to play it instead of this.

Check out the corresponding Towards Data Science article: Reinforcement Learning Lock N' Roll

AI

  • An AI is being trained to master this game, see AI.MD or the aforementioned Towards Data Science article for an overview of that process
  • This readme is an overview of Lock N' Roll the game and how to play it using the Python application

Rules

In addition to the rules explained in this figure, a common rule for Lock N' Roll applications is to treat any board clear as an automatic earned joker, which means a joker bonus if two jokers have already been obtained. This additional rule is incorporated in this application.

Python Rendering

  • The colors yellow, red, blue, and green are rendered as Y, R, B, G respectively
  • The numbers are 1, 2, 3, 4
    • Example: the yellow 1 die is represented as Y1
  • Joker is rendered as JO when placed on the board
  • The board positions are labeled 1 - 16 left-to-right, up-to-down
  • Like this:
"""
		==================
		||01||02||03||04||
		==================
		||05||06||07||08||
		==================
		||09||10||11||12||
		==================
		||13||14||15||16||
		==================
"""

How to Play

  • Uses a command-line interface:
    • cd path/to/directory
    • pip install -r requirements.txt
    • python app.py
  1. To place a die, type 1 followed by a space followed by the die you want to place (ex: R4) followed by a comma, followed by the position you want to place it (no need for the leading zero)
    • Example: typing: "1 R4,1" (no quotes) or "1 r4,1" will place the R4 die on position 1, if you have an R4 die and if position 1 is available
    • Your board will then be rendered as:
"""
		==================
		||R4||02||03||04||
		==================
		||05||06||07||08||
		==================
		||09||10||11||12||
		==================
		||13||14||15||16||
		==================
"""
  1. To place a joker, type 2 followed by a space followed by the position you want to place the joker
    • If a space is already covered by a die, you can still place a joker there by using the space's position as if there were no die there
    • Example: typing "2 6" will place a joker on position 6, whether or not that space has already been played, if you have a joker available
    • Your board will be rendered as
"""
		==================
		||R4||02||03||04||
		==================
		||05||JO||07||08||
		==================
		||09||10||11||12||
		==================
		||13||14||15||16||
		==================
"""
  1. To score the board, clear any spaces based on combinations of dice you have placed on the board, and get new dice if you are out, type 3
  2. If you want to print an empty board, type 4 (this is useful to reference when trying to place a joker)
  3. To let the AI play a move, type 5
  4. To exit, type 6

Note, there is no way to reverse a move, so be careful

locknroll's People

Contributors

mikekeith52 avatar

Stargazers

 avatar

Watchers

 avatar

locknroll's Issues

backspace issue

I had an issue where I attempted to backspace my input and input something new. The first time I did this, the program marked it as an invalid input and continued as normal. The second time I did it the program crashed. It might be my IDE, but this might be something you should look into. I left an image attached to give you a picture.
Screenshot 2021-01-21 223915

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.