Giter Club home page Giter Club logo

python-terminal-game's Introduction

Shut the Box Game

This repository contains the Python code for a single-player variation of the classic pub game 'Shut the Box'.

Introduction

'Shut the Box' is a dice game traditionally played with one or more players. In our unique adaptation, a single player competes against the computer. The game uses a board with flaps numbered from 1 to 9. The flaps can be in either an open or closed state. The player and the computer take turns rolling a die or pair of dice, aiming to change the state of the flaps to match the roll's total.

How to Play

In this variation, the game begins with all flaps in the open state. The player takes the first turn to roll a die (or pair of dice) and closes the flaps that match the total value of the roll. For example, if a player rolls a total of 7, they can choose to close the flaps in the following combinations:

  • 7
  • 1, 6
  • 2, 5
  • 3, 4
  • 1, 2, 4

If no more moves are possible based on the state of the box, the player's turn ends, and the computer's turn begins. The computer's objective is to reopen the flaps using the same rules.

The player wins the game by closing all flaps during their turn. If the computer manages to open all the flaps during its turn, the computer wins.

Requirements

  • Python 3.x

How to Run the Game

To start the game, run the shut_the_box.py script in your Python environment.

Enjoy this unique variation of the classic 'Shut the Box' game!

python-terminal-game's People

Contributors

tconnet avatar

Watchers

 avatar

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.