Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am afish on github.
  • I am afish (https://keybase.io/afish) on keybase.
  • I have a public key whose fingerprint is 3498 9D34 5EE1 DDC8 325E 8D1D 474A 2E16 ABB6 9A89

To claim this, I am signing this object:

maxIterations = 5
var iterations // non-negative integer
iterations.SetLessOrEqual(maxIterations)
var sum // variable representing actual sum
for counter in 1..maxIteratations do
var isLooping = counter.IsLessOrEqual(iterations)
sum = isLooping.Condition(sum + counter, sum)
@afish
afish / IlpLoops
Last active September 27, 2015 13:07
maxIterations = 100 // Assume that we iterate at most one hunder times
var iterations // non-negative integer
iterations.SetLessOrEqual(maxIterations)
var variables // variables which we use in loop
for counter in 1..maxIteratations do
var isLooping = counter.IsLessOrEqual(iterations)
for variable in variables do
variable = isLooping.Condition(
updateVariable(variable, counter),
variable)