Skip to content

Instantly share code, notes, and snippets.

@aurorapar
Created April 18, 2017 02:54
Show Gist options
  • Save aurorapar/b6e9a6d04116e66eab3da1a76ea177f3 to your computer and use it in GitHub Desktop.
Save aurorapar/b6e9a6d04116e66eab3da1a76ea177f3 to your computer and use it in GitHub Desktop.
###
words[2] will be something like:
random(x,y)
where x and y are either 1 or 2 digit integers
###
if "random" in words[2]:
args = words[2].split(",")
# This is a SUPER SLOPPY METHOD
# for doing this, would probably
# look to change syntax of the
# language
lower = ''
for x in args[0]:
if x.isnumeric():
lower += x
lower = int(lower)
upper = ''
for x in args[1]:
if x.isnumeric():
upper += x
upper = int(upper)
current[words[0]] = random.randint(lower, upper)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment