My public transit textile sketch should work #91

Closed
opened 2025-07-07 16:36:01 +00:00 by scott · 1 comment
Owner

This should work; it doesn't.

[This](https://web.ludus.dev/?code=let+rt2+%3D+mult%28sqrt+%282%29%2C+_%29%0A%0Apenwidth%21+%283%29%0Apencolor%21+%28colors+%3Amaroon%29%0Abackground%21+%28colors+%3Aolive%29%0A%0Afn+half+%28n%29+-%3E+div+%28n%2C+2%29%0A%0Afn+centered_line%21+%28len%29+-%3E+%7B%0A++fd%21+%28half+%28len%29%29%0A++bk%21+%28half+%28len%29%29%0A++rt%21+%280.5%29%0A++fd%21+%28half+%28len%29%29%0A++bk%21+%28half+%28len%29%29%0A++rt%21+%280.5%29%0A%7D%0A%0Afn+right_side%21+%7B%0A++%28len%2C+_%2C+_%29+if+lte%3F+%28len%2C+0%29+-%3E+%7Bfd%21+%281%29%3B+bk%21+%281%29%7D%0A++%28len%2C+gap%2C+mod%29+-%3E+%7B%0A++++centered_line%21+%28mod+%28len%29%29%0A++++pu%21+%28%29%0A++++rt%21+%280.25%29%0A++++fd%21+%28div+%28gap%2C+sqrt+%282%29%29%29%0A++++lt%21+%280.25%29%0A++++pd%21+%28%29%0A%0A++++right_side%21+%28sub+%28len%2C+abs+%28gap%29%29%2C+gap%2C+mod%29%0A++%7D%0A%7D%0A%0Afn+striped_square%21+%28side_len%2C+gap%29+-%3E+%7B%0A++let+starting+%3D+unbox+%28turtle_state%29%0A++right_side%21+%28side_len%2C+gap%2C+rt2%29%0A++pu%21+%28%29%0A++loadstate%21+%28starting%29%0A++right_side%21+%28side_len%2C+neg+%28gap%29%2C+rt2%29%0A++pu%21+%28%29%0A++loadstate%21+%28starting%29%0A%7D%0A%0Afn+squared+%28n%29+-%3E+mult+%28n%2C+n%29%0A%0Afn+skip_right%21+%28gap%29+-%3E+%7Bpu%21+%28%29%3B+rt%21+%280.25%29%3B+fd%21+%28gap%29%3B+lt%21+%280.25%29%3B+pd%21+%28%29%7D%0A%0Alet+mygap+%3D+div+%2810%2C+sqrt+%282%29%29%0Afn+chord+%28n%29+-%3E+mult%282%2C+sqrt+%28sub+%28squared+%2850%29%2C+squared+%28mult+%28n%2C+mygap%29%29%29%29%29%0A%0Afn+striped_circle%21+%28diameter%29+-%3E+%7B%0A++let+starting+%3D+unbox+%28turtle_state%29%0A++centered_line%21+%28100%29%0A++skip_right%21+%28mygap%29%0A++centered_line%21+%28chord+%281%29%29%0A++skip_right%21+%28mygap%29%0A++centered_line%21+%28chord+%282%29%29%0A++skip_right%21+%28mygap%29%0A++centered_line%21+%28chord+%283%29%29%0A++skip_right%21+%28mygap%29%0A++centered_line%21+%28chord+%284%29%29%0A++skip_right%21+%28mygap%29%0A++centered_line%21+%28chord+%285%29%29%0A++skip_right%21+%28mygap%29%0A++centered_line%21+%28chord+%286%29%29%0A++skip_right%21+%28mygap%29%0A++centered_line%21+%28chord+%287%29%29%0A++skip_right%21+%28mygap%29%0A++pu%21+%28%29%0A++loadstate%21+%28starting%29%0A++skip_right%21+%28neg%28mygap%29%29%0A++centered_line%21+%28chord+%281%29%29%0A++skip_right%21+%28neg%28mygap%29%29%0A++centered_line%21+%28chord+%282%29%29%0A++skip_right%21+%28neg%28mygap%29%29%0A++centered_line%21+%28chord+%283%29%29%0A++skip_right%21+%28neg%28mygap%29%29%0A++centered_line%21+%28chord+%284%29%29%0A++skip_right%21+%28neg%28mygap%29%29%0A++centered_line%21+%28chord+%285%29%29%0A++skip_right%21+%28neg%28mygap%29%29%0A++centered_line%21+%28chord+%286%29%29%0A++skip_right%21+%28neg%28mygap%29%29%0A++centered_line%21+%28chord+%287%29%29%0A++skip_right%21+%28neg%28mygap%29%29%0A++pu%21+%28%29%0A++loadstate%21+%28starting%29%0A%7D%0A%0Afn+cell_right%21+%28%29+-%3E+%7B%0A++pd%21+%28%29%0A++pencolor%21+%28colors+%3Amaroon%29%0A++rt%21+%280.125%29%0A++striped_square%21+%28100%2C+10%29%0A++lt%21+%280.25%29%0A++pencolor%21+%28%280%2C+255%2C+255%29%29%0A++striped_circle%21+%28100%29%0A++rt%21+%280.125%29%0A++pu%21+%28%29%0A%7D%0A%0Afn+cell_left%21+%28%29+-%3E+%7B%0A++pd%21+%28%29%0A++lt%21+%280.125%29%0A++pencolor%21+%28colors+%3Afuchsia%29%0A++striped_square%21+%28100%2C+10%29%0A++rt%21+%280.25%29%0A++pencolor%21+%28colors+%3Anavy%29%0A++striped_circle%21+%28100%29%0A++lt%21+%280.125%29%0A++pu%21+%28%29%0A%7D%0A%0Arepeat+5+%7B%0A++repeat+5+%7B%0A++++cell_right%21+%28%29%0A++++rt%21+%280.25%29%0A++++fd%21+%28100%29%0A++++lt%21+%280.25%29%0A++++cell_left%21+%28%29%0A++++rt%21+%280.25%29%0A++++fd%21+%28100%29%0A++++lt%21+%280.25%29%0A++%7D%0A++lt%21+%280.25%29%0A++fd%21+%28mult+%2810%2C+100%29%29%0A++rt%21+%280.25%29%0A++bk%21+%28100%29%0A++%0A++repeat+5+%7B%0A++++cell_left%21+%28%29%0A++++rt%21+%280.25%29%0A++++fd%21+%28100%29%0A++++lt%21+%280.25%29%0A++++cell_right%21+%28%29%0A++++rt%21+%280.25%29%0A++++fd%21+%28100%29%0A++++lt%21+%280.25%29%0A++%7D%0A++%0A++lt%21+%280.25%29%0A++fd%21+%28mult+%2810%2C+100%29%29%0A++rt%21+%280.25%29%0A++bk%21+%28100%29%0A%7D) should work; it doesn't.
Author
Owner

Done: it was broken by a change in representing turtle state. Added a function, savestate that gets the current turtle_0 state. Meanwhile, turtle ::state () will return the state of the specific turtle.

Done: it was broken by a change in representing turtle state. Added a function, `savestate` that gets the current `turtle_0` state. Meanwhile, `turtle ::state ()` will return the state of the specific turtle.
scott closed this issue 2025-07-11 19:38:04 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: twc/ludus#91
No description provided.