3 added 7 characters in body

dc is not known for its string handling, but we have just enough here to get this to work. The approach here is to count the ns, and output y if even or n if odd. This is done by executing the input string as a macro. dc will output 'y' (0171) unimplemented errors for all the ys and attempt to pop strings and print them for all the ns. So first we make sure we have plenty (total input string length) of empty strings [] on the stack to pop. Then we execute the input string and see how many [] are left on the stack. The original string length is subtracted from this to give the (-ve) total number of ns. The rest is arithmetic to do mod 2 and have the output come out right as ASCII y or n.

dc is not known for its string handling, but we have just enough here to get this to work. The approach here is to count the ns, and output y if even or n if odd. This is done by executing the input string as a macro. dc will output 'y' (0171) unimplemented for all the ys and attempt to pop strings and print them for all the ns. So first we make sure we have plenty (total input string length) of empty strings [] on the stack to pop. Then we execute the input string and see how many [] are left on the stack. The original string length is subtracted from this to give the (-ve) total number of ns. The rest is arithmetic to do mod 2 and have the output come out right as ASCII y or n.

dc is not known for its string handling, but we have just enough here to get this to work. The approach here is to count the ns, and output y if even or n if odd. This is done by executing the input string as a macro. dc will output 'y' (0171) unimplemented errors for all the ys and attempt to pop strings and print them for all the ns. So first we make sure we have plenty (total input string length) of empty strings [] on the stack to pop. Then we execute the input string and see how many [] are left on the stack. The original string length is subtracted from this to give the (-ve) total number of ns. The rest is arithmetic to do mod 2 and have the output come out right as ASCII y or n.

2 added 708 characters in body

Input string is read from STDIN and should be in the form [yynynynynyyn].

dc is not known for its string handling, but we have just enough here to get this to work:. The approach here is to count the ns, and output y if even or n if odd. This is done by executing the input string as a macro. dc will output 'y' (0171) unimplemented for all the ys and attempt to pop strings and print them for all the ns. So first we make sure we have plenty (total input string length) of empty strings [] on the stack to pop. Then we execute the input string and see how many [] are left on the stack. The original string length is subtracted from this to give the (-ve) total number of ns. The rest is arithmetic to do mod 2 and have the output come out right as ASCII y or n.

dc is not known for its string handling, but we have just enough here to get this to work:

Input string is read from STDIN and should be in the form [yynynynynyyn].

dc is not known for its string handling, but we have just enough here to get this to work. The approach here is to count the ns, and output y if even or n if odd. This is done by executing the input string as a macro. dc will output 'y' (0171) unimplemented for all the ys and attempt to pop strings and print them for all the ns. So first we make sure we have plenty (total input string length) of empty strings [] on the stack to pop. Then we execute the input string and see how many [] are left on the stack. The original string length is subtracted from this to give the (-ve) total number of ns. The rest is arithmetic to do mod 2 and have the output come out right as ASCII y or n.

1

# dc, 39

?dsiZdsl[[]r1-d0<m]dsmxklixzll-2%B*C1+P


dc is not known for its string handling, but we have just enough here to get this to work:

?dsi                                    # Read input string, duplicate, store in register i
Zdsl                                # Get input length, duplicate, store in register l
[         ]                     # define macro to:
[]                             #   push empty string
r                            #   swap empty string and remaining length
1-                          #   subtract 1 from length
d0                        #   duplicate and compare with 0
<m                      #   if >0 recursively call this macro again
dsmx                 # duplicate macro, store in register m and execute