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

Thanks for the feedback. The code examples "[F" and "[[F" both paint one cell but the code "[" produces no visual change, so in that sense there is a difference between them.

Between "[F" and "[[F", there is no visual difference. The command "[" is a control flow command that does not alter the state of the canvas or the invisible turtle. Instead it merely marks the current position in the code as the beginning of a block. The execution continues normally after "[" regardless of whether there is a corresponding closing "]" or not. However, if a corresponding "]" is found, then the execution jumps back to the corresponding "[" and executes the enclosed block once more. This produces the effect of a loop that executes twice. For most drawing purposes the code bounded by "[" and "]" indeed behaves like a loop that executes twice.

I have updated the README to make this clearer. However, I am open to improving the README further if there are better suggestions. Pull requests are welcome too.



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

Search: