Giter Club home page Giter Club logo

ritu-thombre99 / qnim-app Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 4.0 4.44 MB

QNim game is quantum version of classical Nim game. In QNim game, human/classical computer will play against quantum computer. Developed using pygame in python

Python 100.00%
pygame pygame-application pygame-games pygame-gui pygame-library pygame-qiskit ibmq nim nim-game qiskit qnim pygame-qnim qiskit-pygame qnim-game quantum-computing quantumcomputing qamp-fall-22 grover-algorithm quantum-algorithm quantum-algorithms

qnim-app's Introduction

QNim-App

QNim game is a quantum version of classical Nim game. In QNim game, human/classical computer will play against quantum computer. Developed using pygame in python

This project is implemented under the guidance of James Weaver as part of QAMP (Qiskit Advocate Mentorship Program) Fall-22. Project description can be found here.

To see the strategy quantum computer uses to play against classical player (human/computer), see QNim Checkpoint-1

Steps to install QNim on you system

  • Download QNim-App repository
  • Open Anaconda terminal and cd to the location where QNim-App is downloaded
  • Type pip install -r requirements.txt to install required packages
  • To open game window, type python main.py

How to play QNim game

  • Select amount of bulbs you want in each of the four rows on the light board and who should play first on the configuration page and hit start.
  • You can switch off minimum of 1 bulb and maximum of as many bulbs as you can from any one of the row.
  • You cannot switch off bulbs from multiple row at the same time.
  • Bulbs which you can flip during your turn will turn green.
  • When you are done with your turn, hit the quantum computer button for QC to play.
  • Player switching off the last bulb will lose

QNim API

Rest API developed using Flask in python which takes in the board state and returns the QC move. To start API locally on http://127.0.0.1:5000/, use python qnim_api.py in qnim_api folder.

Mathematical framwork: alt text

Experiment result: alt text

Screenshots

Home page: alt text

Home page with current saved game: alt text

Configuration page alt text

Player turn alt text

QC turn alt text

Player won alt text

QC won alt text

Happy playing :)

qnim-app's People

Contributors

ritu-thombre99 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.