Intersecting number wheels: Difference between revisions
→{{header|jq}}: tidy
(→{{header|jq}}: works with) |
(→{{header|jq}}: tidy) |
||
Line 1,371:
# where $wheel is the wheel to be read (a string)
# Input: a set of wheels
# Output: an object such that .value is the next value,
# and .state is the updated state of the set of wheels
def read($wheel):
Line 1,380:
.[$wheel][0] as $value
| (.[$wheel] |= rotate) as $state
| if ($value | type) == "number"
then {$value,
else
end;
#
def multiread($wheel; $n):
if $n <= 0 then empty
|