<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Feb 23, 2014, at 2:26 AM, Peter Otten <__peter__@<a href="http://web.de">web.de</a>> wrote:</div><blockquote type="cite"><div style="font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">which still shows a repetetive pattern and thus you can simplify it with <br>another loop. You should be able to find a way to write that loop with two<br>star_row() calls on a single iteration, but can you do it with a single call<span class="Apple-converted-space"> </span><br>too?<br></div></blockquote></div><br><div>So, I was able to cut it down a bit but I’m having a hard time trying to cut it down with another loop and a single call.  Wouldn’t what you’re saying in the above paragraph have to be another function with a loop inside?  Or are you saying just another loop will suffice?  Any hints?  Here is what I got so far, I’ll put the loop in question in bold. </div><div><br></div><div><div>from turtle import *</div><div>from math import sin, sqrt, radians</div><div>def star(width):</div><div>    R = (width)/(2*sin(radians(72)))</div><div>    A = (2*width)/(3+sqrt(5))</div><div>    penup()</div><div>    left(18)</div><div>    penup()</div><div>    forward(R)</div><div>    pendown()    </div><div>    left(162)</div><div>    forward(A)</div><div>    right(72)</div><div>    forward(A)</div><div>    left(144)</div><div>    forward(A)</div><div>    right(72)</div><div>    forward(A)</div><div>    left(144)</div><div>    forward(A)</div><div>    right(72)</div><div>    forward(A)</div><div>    left(144)</div><div>    forward(A)</div><div>    right(72)</div><div>    forward(A)</div><div>    left(144)</div><div>    forward(A)</div><div>    right(72)</div><div>    forward(A)</div><div>    penup()</div><div>    left(162)</div><div>    forward(R)</div><div>    left(162)</div><div>   </div><div>showturtle()</div><div><br></div><div>def fillstar(color):</div><div>    fillcolor(color)</div><div>    begin_fill()</div><div>    star(25)</div><div>    end_fill()</div><div>red = "red"</div><div>fillstar(red)</div><div><br></div><div>def space(width):</div><div>    penup()</div><div>    forward(2*width)</div><div>    pendown()</div><div><br></div><div>space(25)</div><div><br></div><div>def row(width):</div><div>    penup()</div><div>    right(90)</div><div>    forward(width)</div><div>    right(90)</div><div>    forward(11*width)</div><div>    right(180)</div><div>    pendown()</div><div><br></div><div><b>def star_row(numberstars):</b></div><div><b>    for i in range (numberstars):</b></div><div><b>        fillstar(red)</b></div><div><b>        space(25)</b></div><div><b>        </b></div><div><b>star_row(5)</b></div><div><b>row(25)</b></div><div><b>star_row(5)</b></div><div><b>row(25)</b></div><div><b>star_row(6)</b></div><div><b>row(25)</b></div><div><b>star_row(5)</b></div><div><b>row(25)</b></div><div><b>star_row(6)</b></div><div><b>row(25)</b></div><div><b>star_row(5)</b></div><div><b>row(25)</b></div><div><b>star_row(6)</b></div><div><b>row(25)</b></div><div><b>star_row(5)</b></div><div><b>row(25)</b></div><div><b>star_row(6)</b></div></div><div><br></div><div><br></div><div>This is what I’m thinking…</div><div><br></div><div>for I in range(4)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>star_row(5)</div><div><span class="Apple-tab-span" style="white-space:pre">  </span>row(25)</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>star_row(6)</div><div><span class="Apple-tab-span" style="white-space:pre">  </span>row(25)</div><div><br></div><div><br></div><div>????  Am I at all close?</div><div><br></div><div><br></div></body></html>