RosettaCodeData/Task/100-doors/FALSE/100-doors-1.false
2017-09-25 22:28:19 +02:00

7 lines
338 B
Text

100[$][0 1ø:1-]# {initialize doors}
%
[s;[$101\>][$$;~\:s;+]#%]d: {function d, switch door state function}
1s:[s;101\>][d;!s;1+s:]# {increment step width from 1 to 100, execute function d each time}
1[$101\>][$$." ";$["open
"]?~["closed
"]?1+]# {loop through doors, print door number and state}