https://github.com/jrincayc/ucblogo-code
Tip revision: 7d4fd39c6d7afe4b0946839a1342c4ee4ef18d9b authored by Joshua J. Cogliati on 31 July 2020, 22:31:27 UTC
macOS needs to get the CXX and CC from wx to compile correctly.
macOS needs to get the CXX and CC from wx to compile correctly.
Tip revision: 7d4fd39
for
;;; -*- logo -*-
.macro for :for.values :for.instr ~
[:for.var first :for.values] ~
[:for.initial run first bf :for.values] ~
[:for.final run first bf bf :for.values] ~
[:for.step forstep] ~
[:for.tester (ifelse :for.step < 0 ~
[[:for.initial < :for.final]] ~
[[:for.initial > :for.final]])]
local :for.var
catch "for.catchtag [op for.done runresult [forloop :for.initial]]
op []
end
to forloop :for.initial
make :for.var :for.initial
if run :for.tester [throw "for.catchtag]
run :for.instr
.maybeoutput forloop (:for.initial + :for.step)
end
to for.done :for.result
if emptyp :for.result [op [stop]]
op (list "output "first (list first :for.result))
end
to forstep
if equalp count :for.values 4 [op run last :for.values]
op ifelse :for.initial > :for.final [-1] [1]
end
bury [for forstep forloop for.done]