import random
from time import sleep
import matplotlib.pyplot as plt
from engi1020.arduino.api import *


def find_positions(letter, word):
    """Returns a list of positions where the letter appears in the word.

    Parameters
    ----------
    letter : str
        A single character string representing the guessed letter.
    word : str
        A string representing the chosen word in which to find occurrences of the letter.

    Returns
    -------
    list of int
        A list of positions (indices) where the letter appears in the word.
    """


HANGMAN_PICS = [
'''
   +---+
   O   |
       |
       |
      ===''',
'''
   +---+
   O   |
   |   |
       |
      ===''',
'''
   +---+
   O   |
  /|   |
       |
      ===''',
'''
   +---+
   O   |
  /|\  |
       |
      ===''',
'''
   +---+
   O   |
  /|\  |
  /    |
      ===''',
'''
   +---+
   O   |
  /|\  |
  / \  |
      ===''']

words = [['python', 'java', 'ruby', 'html', 'css'],
         ['hangman', 'programming', 'computer', 'science'],
         ['openai', 'challenge', 'algorithm', 'datastructure']]   

History_n = []
History_s = []

while True:
    
    chosen_word = random.choice()
    guessed_word = ""