Created
April 18, 2017 02:54
-
-
Save aurorapar/b6e9a6d04116e66eab3da1a76ea177f3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
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