RosettaCodeData/Task/Generator-Exponential/Jq/generator-exponential-2.jq
2017-09-25 22:28:19 +02:00

7 lines
239 B
Text

# skip m states, and return the next state
def skip(m; next):
if m <= 0 then . else next | skip(m-1; next) end;
# emit m states including the initial state
def emit(m; next):
if m <= 0 then empty else ., (next | emit(m-1; next)) end;