ucblogo-code
ucblogo-code copied to clipboard
Finish object logo
Finish the object oriented logo additions. These are in #ifdef OBJECTS
blocks.
Note that this is being worked on in the fork: https://github.com/pahihu/ucblogo-code
A lot of these problems have been fixed thanks to @pahihu The configure script now has a --enable-objects
argument.
The manual does not mention things like kindof
So, besides the manual, is there anything else that needs to be fixed to close this bug?
Just make sure USUAL works. The canonical example is
make "double-turtle kindof turtle talkto :double.turtle to forward :dist usual.forward 2*:dist end
make "dashed.turtle kindof turtle talkto :dashed.turtle to forward :dist if :dist < 10 [usual.forward :dist stop] penup usual.forward 5 pendown usual.forward 5 forward :dist-10 end
make "turtle1 (oneof :double.turtle :dashed.turtle) tell :turtle1 [pendown forward 100]
make "turtle2 (oneof :dashed.turtle :double.turtle) tell :turtle2 [pendown forward 100]
What should happen is that they both move 200 steps, but turtle1 does 20 length-5 dashes while turtle2 does 10 length-10 dashes.
If this all actually works I'll add the object primitives to the manual. I'll just copy the ones from the Object Logo manual. Pretty sure I wrote that section anyway... :)
Oh this depends on having turtles as a primitive object class. Is that implemented? I'll try reading the code.
Hi,
The canonical example didn’t worked. I have changed the USUAL implementation, and now it works as expected. Pushed the changes to GitHub.
I have attached the working Logo code and the example screenshot.
Andras Pahi
On 2020. Feb 4., at 5:29, Brian Harvey [email protected] wrote:
Just make sure USUAL works. The canonical example is
make "double-turtle kindof turtle talkto :double.turtle to forward :dist usual.forward 2*:dist end
make "dashed.turtle kindof turtle talkto :dashed.turtle to forward :dist if :dist < 10 [usual.forward :dist stop] penup usual.forward 5 pendown usual.forward 5 forward :dist-10 end
make "turtle1 (oneof :double.turtle :dashed.turtle) tell :turtle1 [pendown forward 100]
make "turtle2 (oneof :dashed.turtle :double.turtle) tell :turtle2 [pendown forward 100]
What should happen is that they both move 200 steps, but turtle1 does 20 length-5 dashes while turtle2 does 10 length-10 dashes.
If this all actually works I'll add the object primitives to the manual. I'll just copy the ones from the Object Logo manual. Pretty sure I wrote that section anyway... :)
Oh this depends on having turtles as a primitive object class. Is that implemented? I'll try reading the code.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jrincayc/ucblogo-code/issues/21?email_source=notifications&email_token=ADTEB26DHOECTVISL6WIXMTRBDVKDA5CNFSM4KCO74AKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKWJ2JI#issuecomment-581737765, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTEB2YL6S4EZZXGVF6EJ6DRBDVKDANCNFSM4KCO74AA.
@pahihu Thanks, I made a merge request out of it.
So, I realized later that there's no TURTLE primitive because ucblogo doesn't have multiple turtles. There's actually a whole bunch of "system objects" in Object Logo, at least some of which might be interesting. See attached chart. Files, turtles, windows, menus, menu items are things it would be great to have in version 7.0. Maybe I can throw some students at that.
Hi,
I’ve made a simple Turtle class in Object Logo, so you can actually have multiple turtles. The code is attached.
Andras
On 2020. Feb 7., at 5:45, Brian Harvey [email protected] wrote:
So, I realized later that there's no TURTLE primitive because ucblogo doesn't have multiple turtles. There's actually a whole bunch of "system objects" in Object Logo, at least some of which might be interesting. See attached chart. Files, turtles, windows, menus, menu items are things it would be great to have in version 7.0. Maybe I can throw some students at that. https://user-images.githubusercontent.com/3885074/74001745-99204a00-4921-11ea-917a-6b0339972ce6.png — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jrincayc/ucblogo-code/issues/21?email_source=notifications&email_token=ADTEB22ACHDHKXSNJSYBVTTRBTRO3A5CNFSM4KCO74AKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELBWTJQ#issuecomment-583231910, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTEB26WQIWPZAZLCXLPQH3RBTRO3ANCNFSM4KCO74AA.
Excellent! Thanks so much!