Last active
February 23, 2017 16:54
-
-
Save Mortimal/ed7b1607c912550395efd99672ab0d01 to your computer and use it in GitHub Desktop.
This file contains 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
#Parser.pm | |
elsif ($kw eq 'rndxy') {$ret = getRandomCoords($arg); $randomized = 1} | |
#Utilities.pm | |
sub getRandomCoords { | |
return ((int(rand(($_[0]+$_[2])-($_[0]-$_[2])+1))+($_[0]-$_[2]))." ". | |
(int(rand(($_[1]+$_[2])-($_[1]-$_[2])+1))+($_[1]-$_[2])) | |
) if (@_ = split(/,\s*/, $_[0])) or return "0 0"; | |
} | |
# @rndxy(150,150,5) | |
# u get random <145to155> <145to155> | |
# | |
# | |
# | |
# |
allanon
commented
Feb 23, 2017
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment