Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2010-09-27 00:26:00 (GMT)
committer Walter Bender <walter@sugarlabs.org>2010-09-27 00:26:00 (GMT)
commitd2a60c4ae61bef176f7ff92b6ff36c2e33ebf37a (patch)
treed66d893753ef7e5579695f1357aeca668d1f0fca /TurtleArt
parent60da59ff0a96b996405b7b25e5ccb64dae03d646 (diff)
round(uniform) to fix problem with missing max values (#2380)
Diffstat (limited to 'TurtleArt')
-rw-r--r--TurtleArt/talogo.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py
index 0bcddb1..43886f0 100644
--- a/TurtleArt/talogo.py
+++ b/TurtleArt/talogo.py
@@ -212,18 +212,18 @@ def tasqrt(x):
def tarandom(x, y):
""" Random integer """
if numtype(x) and numtype(y):
- return(int(uniform(x, y)))
+ return(int(round(uniform(x, y),0)))
xx, xflag = chr_to_ord(x)
yy, yflag = chr_to_ord(y)
print xx, xflag, yy, yflag
if xflag and yflag:
- return chr(int(uniform(xx, yy)))
+ return chr(int(round(uniform(xx, yy),0)))
if not xflag:
xx = str_to_num(x)
if not yflag:
yy = str_to_num(y)
try:
- return(int(uniform(xx, yy)))
+ return(int(round(uniform(xx, yy),0)))
except TypeError:
raise logoerror("#notanumber")