Difference between revisions of "CSC111 Homework 11 solution program"

From dftwiki3
Jump to: navigation, search
(Source)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
--[[User:Thiebaut|D. Thiebaut]] 12:22, 28 April 2010 (UTC)
 
--[[User:Thiebaut|D. Thiebaut]] 12:22, 28 April 2010 (UTC)
 
----
 
----
 
+
<onlydft>
 
==Zip file==
 
==Zip file==
 
The program and all the gif files associated with it can be found in this [[Media:CSC111_hw11_solution.zip | zip file]].
 
The program and all the gif files associated with it can be found in this [[Media:CSC111_hw11_solution.zip | zip file]].
Line 132: Line 132:
 
     def swim(self):
 
     def swim(self):
 
         """moves the fish horizontally and randomly up and down"""
 
         """moves the fish horizontally and randomly up and down"""
         ddy = [-3, -2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3]
+
         ddy = [-3, -2, -1, 1, 2, 3] + 15*[0]
 
         index = randrange(len(ddy))
 
         index = randrange(len(ddy))
 
         if self.d:
 
         if self.d:
Line 232: Line 232:
  
 
</source>
 
</source>
 
+
</onlydft>
 
<br />
 
<br />
 
<br />
 
<br />

Latest revision as of 08:42, 7 September 2011

--D. Thiebaut 12:22, 28 April 2010 (UTC)



...