Quantum version of the classical Nim game. An automatic opponent allows to game to not be as easy as it seems.

Overview

Nim game

Running the game

To run the program just launch : python3 game.py

Rules

This game is inspiring from the Nim game. You are 2 players face to face, you have 11 sticks in front of you :

          \o/
           |
          / \
#######################
 | | | | | | | | | | | 
#######################
          \ /
           |
          /o\

The goal is NOT take the last stick !! Originally, this game can be automatize by classical computer to always loose again a computer or against someone knowing the strategy. But what happens if we implement quantum rules ?

Like the original game each player can take 1 to 3 sticks each turn but this time, they can say if they want to take the stick normally, put it in superposition or creating an entanglement between this stick and the sticks previously on the board (played before) :

Symbols table name means action possible ?
| stick left a simple sticks any action
/ superposition stick sticks in states : |0> + |1> no action (only here for info)
¬ entangle stick the faith of this stick depends of the previous one no action (only here for info)
[ ] blank space the previous stick has been fully taken an cx action can be done with if it's not the first turn of the circuit generation

Here each stick correspond to a qubit at the |0> state.

Example of a game : 11 sticks in board : | | | | | | | | | | |
1st turn :
Robin choose 2 sticks

  • Robin apply an x gate the 11th stick
  • Robin apply an h gate to the 10th stick

9 sticks in board : | | | | | | | | | /
Batman choose 3 sticks

  • Batman apply a cx to the 9th stick (now the 9th stick is automatically link with the 10th)
  • Batman apply a x gate to the 8th stick
  • Batman apply a x gate to the 7th stick

6 sticks in board : | | | | | |

etc ...

2 sticks left : | | ¬
Robin choose 1 sticks

  • Robin apply an x gate to the 2nd stick

1 sticks left : |
Batman choose 1 sticks

  • Batman apply an x gate to the last stick

When it doesn't have a stick anymore we run the circuit we create with the gates and get the result, for each qubit still at the state |0> we had 1 stick left. Then we continue wit the sticks remaning until we don't have stick at all after running the circuit.

Modes

2 players

A 2 players mode is available is you want to play with a friend or with your cat

1 player

A 1 player is available and you'll fight against a quantum ia made with a quadratical equation, QAOA and Grover.

You might also like...
This a Chess PGN saver which allows you to save your game pgns, in a .pgn file
This a Chess PGN saver which allows you to save your game pgns, in a .pgn file

PGN Saver This a Chess PGN saver which allows you to save your game pgns, in a .pgn file This can be a very useful tool for the people using chessbase

Open source Brawl Stars server emulator for version 29 of the game!
Open source Brawl Stars server emulator for version 29 of the game!

Welcome to Classic-Brawl v29 Remake 👋 Open source Brawl Stars server emulator for version 29 of the game! (Remake) What's working ? Battles Trophies

This is a Python solver for the game Wordle, which recently received its PT-BR version

PT_BR_Wordle_Solver Este é um solver feito em Python do jogo Wordle, que recebeu sua versão PT-BR recentemente. Onde jogar Os sites para se jogar mais

An easy to use game engine/framework for python.
An easy to use game engine/framework for python.

A game engine powered by python and panda3d.

Easy and fun game to play a bit. Written in python
Easy and fun game to play a bit. Written in python

NumGuesser Easy and fun game to play a bit. Written in python

Minecraft-Bedrock-Modpack-Maker - Simple tool to combine multiple addons into one. Not finished

Minecraft-Bedrock-Modpack-Maker Simple tool to combine multiple addons into one. Not finished! Any contributing is welcome. How to use: Move all .mcpa

Parkour game made in Python with Ursina Game Engine along with ano0002, Greeny127 and Someone-github Snake game mixed with Conway's Game of Life
Snake game mixed with Conway's Game of Life

SnakeOfLife Snake game mixed with Conway's Game of Life The rules are the same than a normal snake game but you have to avoid cells created by Conway'

Lint game data metafiles against GTA5.xsd for Rockstar's game engine (RAGE)
Lint game data metafiles against GTA5.xsd for Rockstar's game engine (RAGE)

rage-lint Lint RAGE (only GTA5 at the moment) meta/XML files for validity based off of the GTA5.xsd generated from game code. This script accepts a se

Releases(2.1)
Owner
Michaël
Qiskit Advocate & Fan of AI Electrical engineer @ESNFranceG33kTeam
Michaël
Repository for the DecodED2 Game Project!

DecodED2 Game Project Hello everyone! Welcome to the GitHub Repository for DecodED2, as a start you'll need to clone this repository and make sure you

6 Sep 29, 2021
This Country Hangman game written in Python.

country-name-guess-hangman-game This Country Hangman game written in Python. Visit https://example.com to play the game. Description How to play this

Aytaç Kaşoğlu 1 Oct 30, 2021
Multiplayer 2D shooter made with Pygame

PyTanks This project started as a one day project with two goals: Create a simulated environment with as much logic as possible written in Numpy, to o

Felix Chippendale 1 Nov 07, 2021
Discord based board game, Sneks and Ladders

sneks-and-ladders Discord based board game, Sneks and Ladders intro This is the code-base for the Discord based game, Sneks and Ladders, as used for s

Yohei Nakajima 3 Nov 04, 2022
3D online shooter written on Panda3D 1.10.10 and Python 3.10.1

на русском itch.io page Droid Game 3D This is a fresh game that was developed using the Panda3D game engine and Python language in the PyCharm IDE (I

Marcus Kemaul 5 Jun 04, 2022
Useful guides, tutorials, and FAQs related to LEGO Universe and Darkflame Universe.

Awesome Lego Universe A curated list of awesome things related to LEGO Universe. LEGO Universe was a kid-friendly massively-multiplayer online role pl

Eric Myllyoja 33 Dec 12, 2022
Attempts to solve Wordle-like puzzles.

Attempts to solve Wordle-like puzzles.

cotman 1 Feb 14, 2022
A minimal open source mtg-like tcg game made in python that can be played on a terminal emulator using a keyboard.

A minimal open source mtg-like tcg game made in python that can be played on a terminal emulator using a keyboard.

Amos 3 Aug 29, 2021
Python Interactive Mini Games

Python Interactive Mini Games Mini projects from Coursera's An Introduction to I

Ashish Choudhary 1 Jan 16, 2022
An all-inclusive Python framework for the Riot Games League of Legends API. We focus on making the data easy and fun to work with, while providing all the tools necessary to create a website or do data analysis.

Cassiopeia A Python adaptation of the Riot Games League of Legends API (https://developer.riotgames.com/). Cassiopeia is the sister library to Orianna

Meraki Analytics 473 Jan 07, 2023
This is text based adventure game

CHOOSE-YOUR-OWN-ADVENTURE This is text based adventure game CONTRIBUTORS Aditya binukumar Srishti Sharma Shiva Tripathi Tanishq Tanwar ABOUT Theme: Ho

Tanishq Tanwar 3 May 31, 2022
This a secret santa game organizer that assigns secret santa randomly to each participant and then sends an automated mail to each santa with details of his/her secret santa child.

Before executing the script, make sure to turn on 'Less Secure App access' option from your gmail ID that will be used to send out the mails to all participants of the game. To do so, get going with

DEV_FINWIZ 10 Dec 06, 2022
🐍 Conway's Game of Life cellular automaton implemented in PyGame

Conway's Game of Life My PyGame implementation of Conway's Game of Life. This implementation involves treating all edges of the grid as stitched toget

Mateusz Żebrak 1 May 29, 2022
We tried to recreate this classic game using python physics libraries.

We tried to recreate this classic game using python physics libraries. The result is certainly hilarious but enjoyable. One of my very first physics application.

Delwys Glokpor 2 Dec 12, 2021
For educational purposes, a simple script that assists in solving the word game Wordle.

WordleSolver For educational purposes, a simple script that assists in solving the word game Wordle. Instructions Pick your first word from the sugges

Christian De Leon 2 Mar 25, 2022
Game using Python

🎡 Rock-Paper_Scissor Game Using Python Beginner Friendly Easy to use ♟ Want to Play this? Clone this repository Open in any IDE(for eg. VS Code, PyCh

Akash Kumar 1 Oct 17, 2021
Easily manage wine prefixes in a new way. Run Windows software and games on Linux

Bottles Easily manage wineprefix using environments Documentation · Forums · Telegram group · Funding 📚 Documentation Before opening a new issue, che

Bottles 4.1k Jan 09, 2023
Minecraft Script to Tellraw Datapack Generator

Minecraft Script to Tellraw Datapack Geneator (STDG) can generate a chain of tellraw command in datapack from script.

1 Jan 28, 2022
Arcade-like space shooter game written entirely in python

E.T.-Attack Arcade-like space shooter game written entirely in python Project description A space shooter game - inspired by the legendary game Space

Sven Eschlbeck 2 Dec 17, 2022
Trio Assembly Snakemake Workflow

Trio Assembly Snakemake Workflow Input HiFi reads for child in bam format Either

Juniper A. Lake 1 Jan 28, 2022