Git Product home page Git Product logo

qpong-pico-8's Introduction

QPong

This is a quantum version of classic game Pong using IBM Qiskit and PyGame. This game was initiated in IBM Qiskit Camp 2019 by Huang Junye, Jarrod Reilly, Anastasia Jeffery and James Weaver based on James Weaver's quantum-circuit-pygame package: https://github.com/JavaFXpert/quantum-circuit-pygame

NEW! Unity version is being actively developed over here: https://github.com/HuangJunye/QPong-Unity

Story

In the dawn of the Quantum Era, a primitive 3-qubit Quantum Computer is trying to challenge the Classical Computer, the long-time ruler of the Computer Empire. Your mission is to use your Human Intelligence to help the Quantum Computer defeat the Classical Computer and demonstrate "quantum supremacy" for the first time in human history. The battle field of the Quantum-Classic war is none other than the classic Pong game.

Installation

To play the game, you will need to install Python and three required packages. To do that, you need to use command line tool (Command Prompt for Windows or Terminal for macOS).

Open command line tool

On Windows, open Command Prompt by typing "Command Prompt" on the search box of Start menu. Check this link if you are not sure about how to do that: https://www.wikihow.com/Open-the-Command-Prompt-in-Windows

On macOS, press Command + Space to open Spotlight. Type "Terminal" on Spotlight to open Terminal. Check this link if you are not sure about how to do that: https://www.wikihow.com/Open-a-Terminal-Window-in-Mac

Install Python

You can install Python from https://www.python.org/ or install Anaconda from https://www.anaconda.com

Install required packages

There are three Python packages required to run the game: PyGame, Qiskit and matplotlib.

Run pip install [package name] on command line tool (same for Windows and macOS) to install the packages. For example:

pip install pygame

Install QPong

Clone or download the master branch by clicking the green button on the top right corner on this page (above the files and below "contributors"). Unzip the files to the "Downloads" folder on your computer.

Change the directory to the downloaded files. (Downloads/QPong-master)

On Windows, run the following code to change your directory to the QPong folder:

cd C:\users\[your username]\downloads\QPong-main\

On macOS, run the following code to change your directory to the QPong folder:

cd Downloads/QPong-main/

On both Windows and macOS, run the following command to start the game:

python main.py

How to play

Keyboard

W, A, S, D: Up, Left, Down, Right to move cursor

SPACE: delete gate

X, Y, Z, H: add Pauli-X, Pauli-Y, Pauli-Z, Hadamard gate

C: add CNOT gate

UP, DOWN: move control qubit up or down

Left, Right: add rotation to a gate, at pi/8 step

TAB: update visulization

Joystick

Joystick button correspondence depends on the model of joystick. Details will be added later

Credits

Sound effects are made by NoiseCollector from Freesound.org: https://freesound.org/people/NoiseCollector/packs/254/ Font used in the game is Bit5x3 made by Matt LaGrandeur: http://www.mattlag.com/bitfonts/

qpong-pico-8's People

Contributors

alfa871212 avatar ethanlee515 avatar huangjunye avatar siddharthgolecha avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

qpong-pico-8's Issues

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.