Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Thanks! Glad you like it. The sibling comment by majewsky is spot on. There is not much parsing going on. Every character is read one at a time and the turtle's state is changed. Indeed the "[" and "]" commands are implemented with a stack.

The entire implementation is a single HTML page written in plain HTML + JavaScript. The evaluation of the code happens here: <https://github.com/susam/cfr/blob/0.2.0/cfr.html#L204>.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: