Open main menu
Home
Random
Log in
Settings
About Sugar Labs
Disclaimers
Sugar Labs
Search
Changes
← Older edit
Newer edit →
Activities/Turtle in a Pond
(view source)
Revision as of 05:08, 30 November 2011
222 bytes added
,
05:08, 30 November 2011
→Strategy
Line 41:
Line 41:
def _turtle_strategy(self, turtle):
def _turtle_strategy(self, turtle):
turtle[1] +=1
turtle[1] +=1
+
return turtle
+
</pre>
+
+
In this version, the turtle moves down until it is blocked.
+
<pre>
+
def _turtle_strategy(self, turtle):
+
if not self._dots[self._grid_to_dot((turtle[0], turtle[1]+1))].type:
+
turtle[1] +=1
return turtle
return turtle
</pre>
</pre>
Tonyforster
2,486
edits