(no title)
drewtato | 2 years ago
F (fill/forward): draw a pixel and move forward
C (color): change the color
R (rotate): rotate the direction of F by 45 degrees
[ ... ] (loop): anything inside this is executed twice
drewtato | 2 years ago
F (fill/forward): draw a pixel and move forward
C (color): change the color
R (rotate): rotate the direction of F by 45 degrees
[ ... ] (loop): anything inside this is executed twice
susam|2 years ago
Are you referring to the short list at the top of the README on GitHub? That list does not provide "syntax definitions". That's just a quick introduction about what is about to come.
The commands are explained in detail in the section "Commands" later here: https://github.com/susam/cfr#commands
> F (fill/forward): draw a pixel and move forward
The command "F" does not draw a pixel and move forward. Instead "F" moves forward first and then draws a cell.
> [ ... ] (loop): anything inside this is executed twice
The control flow command "[" can be written without a corresponding "]". For example "[", "[F", "[[F", etc. are valid CFR[] inputs. Again, the section of the README I have linked to above defines what "[" and what "]" are.
drewtato|2 years ago
kaoD|2 years ago
Are those different from just "F"?
If not, even if those are technically valid syntax, op's explanation seems clearer. I was confused by the README definition too and came to op's conclusion after experimenting for a while.
If they are not equivalent to just "F" I still don't get the distinction so the README definition is not very good considering it confused at least both op and me.
(This is meant as constructive criticism, I'm having a lot of fun playing with this.)
hipadev23|2 years ago
[deleted]
unknown|2 years ago
[deleted]