Odd word problem: Difference between revisions
Content deleted Content added
Added Quackery. |
→{{header|Quackery}}: removed test for end of string |
||
Line 2,261:
It is not possible to comply with the requirements of this task ''to the letter'' as the task presumes the existence of an ''implicit'' stack, e.g. a stack frame storing state information during subroutine calls, including recursive calls. In Quackery such information is stored on a second stack (usually referred to as ''the stack'') which is ''explicit''.
Also, there is no character-at-a-time input stream mechanism implemented in Quackery.
Therefore this solution is in the spirit of the requirements, if not the letter.
<lang Quackery>[ upper dup lower != ]
[ [ behead
emit again ]
dup emit
emit backwords ] is forwords ( $ --> $ )▼
char . !=
[ [ behead
swap recurse
rot emit ]
dup emit
emit forwords ] resolves backwords ( $ --> $ )▼
char . !=
[ forwords drop cr ]
$ "we,are;not,in,kansas;any,more." oddwords
|