diff options
author | Walter Bender <walter@walter-laptop.(none)> | 2009-07-22 22:03:46 (GMT) |
---|---|---|
committer | Walter Bender <walter@walter-laptop.(none)> | 2009-07-22 22:03:46 (GMT) |
commit | 3c3b445f71b6b4a31637b6c1045274e4ce7fbc4f (patch) | |
tree | ba47e6fba760eec37fb69635112c90b54cee623f | |
parent | 3244f8d375400b483f23b5d7b83857be00c23943 (diff) |
greater and less
-rw-r--r-- | talogo.py | 12 | ||||
-rw-r--r-- | tawindow.py | 2 |
2 files changed, 11 insertions, 3 deletions
@@ -351,9 +351,17 @@ def taequal(x,y): def taless(x,y): try: - return(x<y) + return float(x)<float(y) except: - raise logoerror("#syntaxerror") + if type(x) == str or type(x) == unicode: + xx = ord(x[0]) + else: + xx = x + if type(y) == str or type(y) == unicode: + yy = ord(y[0]) + else: + yy = y + return xx<yy def tamore(x,y): return taless(y,x) diff --git a/tawindow.py b/tawindow.py index b65b4d0..bed16f3 100644 --- a/tawindow.py +++ b/tawindow.py @@ -482,7 +482,7 @@ def dock_dx_dy(block1,dock1n,block2,dock2n): if block1==block2: return (100,100) if d1type!=d2type: # some blocks can take strings or nums - if block1.proto.name in ('write', 'plus2', 'equal', \ + if block1.proto.name in ('write', 'plus2', 'equal', 'less', 'greater', \ 'template1', 'template2', 'template3', 'template4', \ 'template6', 'template7', 'nop', 'print'): if block1.proto.name == 'write' and d1type == 'string': |