"Any time you see a turtle on top of a fence post...


                                                                          ...you know she had some help!"

    Writer, Alex Haley said those words and they rang true this week as I worked with my turtles on turtles.sugarlabs.com trying to compose my name - our assignment in coding for this week.


    I was able to create the  "J" using forward/back/right/left without trouble and then proceeded to do the others.  T
he code looked like this... (pretty cool, right?!)



    But then I wanted to try to create some of the letters using the xy option.  This required several hours of crazy 😱 .  Ultimately, I did figure it out and got all of my letters done but when printed, the letters that were coded with the xy component (A,N & U) insisted upon being realized at the origin of x and y...


    I also wanted to code my name to function two ways from two chunks.  In other words, pressing "start" from one column would create my name consecutively and then pressing "start" on another column would print my name simultaneously with all seven turtles active across the screen at the same time. I struggled with this for a few days and then met up with Dr. A. during office hours. 

    First I needed to solve the problem of sending the letters where I wanted them on the screen. By adding a "set xy" command to each of the the letters and designating a number to represent the location, I could move the start of the letter to anywhere on the x axis.  For example, I started the "J" at -600, then the "A" at -400 and so on across the screen. Using the graph function was imperative though there was still quite a bit of trial and error.

    The second problem (one that I should have intuited) was that the system was reading the letters with the xy coordinates as an absolute x...all starting at the origin.  To manipulate that, I needed to "store in" a position for the x, in a sense overriding the system to move the letter to wherever I had set the xy at the top of the column...


    I kept working on this right up until I posted this blog entry.  To date, here are some of the fun images that emerged during my attempts...




                                                            I'll eventually get it.


Of course...a turtle that is on top of a fence post
 will also need help getting down :) !

~ J






Comments

  1. I love how you showed the whole story including the "mistakes". The beauty of coding is that you can quickly see your results and can troubleshoot systematically. Nicely done!

    ReplyDelete

Post a Comment

Popular Posts