# We import necessary libraries from Qiskit
from qiskit import QuantumCircuit, Aer, execute

# We create a quantum circuit with one qubit
coin_flip_circuit = QuantumCircuit(1, 1)

# We apply the H-gate (Hadamard gate) to create a superposition
coin_flip_circuit.h(0)

# We measure the qubit
coin_flip_circuit.measure(0, 0)

# We simulate the circuit on a classical simulator
simulator = Aer.get_backend('qasm_simulator')
result = execute(coin_flip_circuit, simulator, shots=1).result()
counts = result.get_counts()

from termcolor import colored

# We print the outcome with colored text and ASCII art
if '0' in counts:
    print(colored("  _______     \n /       \\    \n| (•) (•) |   \n|    ^    |   \n \\_______/    \n", 'red'))
    print(colored("The quantum coin landed on 'Heads' (|0⟩)!", 'red'))
else:
    print(colored("  _______     \n /       \\    \n| (•) (•) |   \n|    v    |   \n \\_______/    \n", 'green'))
    print(colored("The quantum coin landed on 'Tails' (|1⟩)!", 'green'))