Skip to content

Commit

Permalink
correct requierements + add random start
Browse files Browse the repository at this point in the history
  • Loading branch information
mickahell committed Dec 14, 2021
1 parent 32df070 commit 664e261
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fire
qiskit
qiskit-optimization
qiskit_optimization
requests
4 changes: 3 additions & 1 deletion src/function.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Input controler to check the input from player."""
import math
from qiskit import Aer, QuantumCircuit, execute


Expand All @@ -22,7 +23,8 @@ def control_input(options: int, input_ctl: int) -> bool:
print("Please give a valid gate between {}".format(options))
return False

def who_start(psi: int, backend_sim: Aer) -> int:

def who_start(psi: float, backend_sim: Aer) -> int:
"""Function to check who start.
Args:
psi: angle for the qubit
Expand Down
3 changes: 2 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ def battle(player1: list, player2: list, backend_sim: Aer) -> Tuple:
if nb_player == "1":
computer[1] = True

begin = who_start(psi=0.5, backend_sim)
begin = who_start(psi=0.5, backend_sim=backend_sim)
if begin == 0:
player1[0] = True
print("You start")
else:
player2[0] = True
computer[0] = True
Expand Down

0 comments on commit 664e261

Please sign in to comment.