<commit_before><commit_msg>Created a turtle hack post<commit_after>--- 
layout: post
author: jpanken
title: "Jaffa's Turtle Exercise"
---
Here's the program I'm embedding:
<iframe src="https://trinket.io/embed/python/fb814f79b7" width="100%" height="600" frameborder="0" marginwidth="0" marginheight="0" allowfullscreen></iframe>


Careful, my turtle program may induce seizures...Some people find it captivating, others nauseating.  Unfortunately, I'm one of the latter.


I started writing this program by Googling "python turtle tricks."  This pulled up some optical illusions based on loops that I tested.  After several trippy results, I found a design that looked interesting (https://michael0x2a.com/blog/turtle-examples).  After observing how the loop works, I was able to modify the lengths and colors to produce something that looked like a sun.  After playing around more, I saw that I could turn it into an eye as well.  Then, I thought about putting a star in the middle of the iris to suggest "starry eyed."  


The hardest part was creating a star.  I started by Googling and found a discussion about creating a filled star.  Though many people offered suggestions, none of them were quite right as it was difficult to fill in the entire star.  I tried a bunch of different approaches, including a loop that drew a spiral star.  In the end, I decided to draw a pentagon and then draw 5 triangles with 70-70-40 angles.  My rusty math skills meant that I was unable to find a neat solution so I just knuckled-down and did everything by trial-and-error.  As a result, the star is passable, but not perfect.  If I had better spatial reasoning, maybe I could have figured out a neater way to accomplish the result.


Despite my sad star, I did make some strides toward incorporating our lessons into this program.  I was able to write a loop to draw the pentagon and use a prompt and a variable to allow viewers to customize their star.  I hope to use these skills to write a more complicated program in the future.
{'fraction_non_alphanumeric': 0.05283950617283951, 'fraction_numerical': 0.011851851851851851, 'mean_word_length': 4.208226221079691, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '244879', 'n_tokens_mistral': 554, 'n_tokens_neox': 506, 'n_words': 316}