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 12:49, 30 November 2011
2 bytes added
,
12:49, 30 November 2011
m
→Strategy
Line 27:
Line 27:
<pre>
<pre>
def _turtle_strategy(self, turtle):
def _turtle_strategy(self, turtle):
−
turtle[1] +=1
+
turtle[1] += 1
return turtle
return turtle
</pre>
</pre>
Line 35:
Line 35:
def _turtle_strategy(self, turtle):
def _turtle_strategy(self, turtle):
if not self._dots[self._grid_to_dot((turtle[0], turtle[1]+1))].type:
if not self._dots[self._grid_to_dot((turtle[0], turtle[1]+1))].type:
−
turtle[1] +=1
+
turtle[1] += 1
return turtle
return turtle
</pre>
</pre>
Walter
Bureaucrats
,
Administrators
10,579
edits