Embedded Linux IoT
3. Write a program that uses Flask, that plays the classic game of rock, paper, scissors. The game rules are that rock beats (breaks) scissors, scissors beat (cuts) paper, and paper beats (covers) a rock. The program responds to the following path rules. Entering a choice starts a game round.
a) / - Return a message that describes what the program is about and does
b)/rock/ -Your choice isrock
c) /paper/ - Your choice is paper
d) /scissors/ -Your choice is scissors
The following assigns the possible choices to a tuple of strings. Choices = ("rock","paper","scissors")
The program will use the random number library to randomly make a choice and return a string that explains whether you won or lost the round. The following configure the library: import random random.seed()
To produce a random choice, use the following:
chx = int( 3 * random.random() )