on lines 15 and 16 you need to check if the result is "A" or "B". The repeat should be before the input so you loop until you get a valid response. Don't want then player sending garbage to your code.