Added less-than-flattening example. LT-Flattening is experimental!
This commit is contained in:
parent
600cc8c25c
commit
8e7197438f
1 changed files with 23 additions and 0 deletions
23
examples/functions/lt_comparison
Normal file
23
examples/functions/lt_comparison
Normal file
|
@ -0,0 +1,23 @@
|
|||
def lt(a,b):
|
||||
return if a < b then 1 else 0 fi
|
||||
|
||||
def cutoff():
|
||||
return 31337
|
||||
|
||||
def getThing(index):
|
||||
result = 3
|
||||
result = if index == 0 then 13 else result fi
|
||||
result = if index == 1 then 23 else result fi
|
||||
result = if index == 2 then 43 else result fi
|
||||
result = if index == 3 then 53 else result fi
|
||||
result = if index == 4 then 73 else result fi
|
||||
result = if index == 5 then 83 else result fi
|
||||
return result
|
||||
|
||||
def cubeThing(thing):
|
||||
return thing**3
|
||||
|
||||
def main(index):
|
||||
thing = getThing(index)
|
||||
thing = cubeThing(thing)
|
||||
return lt(cutoff(), thing)
|
Loading…
Reference in a new issue