Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from datetime import datetime
- import DiceRoller
- import DiceRoller as Droller
- import random
- def sample_responses(input_text):
- user_message = str(input_text).lower()
- # if user_message:
- # return user_message + '!'
- if user_message in "points":
- return "current credit:"
- if user_message.startswith("play"):
- # return user_message + '!'
- input_strings = user_message.split(' ')
- game_type = input_strings[1]
- point_value = int(input_strings[2])
- rand_num = random.randint(2, 12)
- print(rand_num)
- if game_type == 'small':
- if 2 <= rand_num <= 6:
- return "you win"
- else:
- return "you lose"
- if game_type == 'big':
- if 2 >= rand_num >= 6:
- return "you win"
- else:
- return "you lose"
- if game_type == 'odd':
- if rand_num % 2 == 0:
- return "you lose"
- else:
- return "you win"
- if game_type == 'even':
- if rand_num % 2 == 0:
- return "you win"
- else:
- return "you lose"
- values = range(2, 13)
- # print(values)
- strings = ["{:d}".format(x) for x in values]
- # print(strings)
- if game_type in strings:
- if game_type == str(rand_num):
- return "you win"
- else:
- return "you lose"
- # return "play " + game_type + "_" + str(point_value)
- return "I don't understand"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement