Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- USING: io kernel math math.parser strings sequences locals ;
- IN: template
- :: test ( rtn cur -- a b )
- cur "" =
- [ rtn cur ]
- [
- cur 1 tail
- cur 1 head
- "(" =
- [ "(" rtn append ]
- [
- rtn 1 head
- "(" =
- [ rtn 1 tail ]
- [ "X" rtn append ]
- if
- ]
- if
- swap
- test
- ]
- if ;
- "Z"
- readln
- test
- drop
- "Z" =
- [ "YES" ]
- [ "NO" ]
- if
- print
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement