moving files
This commit is contained in:
		
							
								
								
									
										27
									
								
								q1/04oct/ex4.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								q1/04oct/ex4.py
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,27 @@ | ||||
| from uturtle import ( | ||||
|     umonsTurtle, wait, | ||||
|     moveForward, moveBackward, | ||||
|     turnLeft, turnRight, | ||||
|     dropPen, usePen) | ||||
|  | ||||
| from ex3 import koch | ||||
|  | ||||
|  | ||||
| def flocon(t, x, seuil, sides=3): | ||||
|     """draw a star with koch """ | ||||
|     flocon_rec(t, x, seuil, sides, sides) | ||||
|  | ||||
|  | ||||
| def flocon_rec(t, x, seuil, sides, i): | ||||
|     """recursion function of flocon()""" | ||||
|     if i > 0: | ||||
|         koch(t, x, seuil) | ||||
|         turnRight(t, 360/sides) | ||||
|         flocon_rec(t, x, seuil, sides, i-1) | ||||
|  | ||||
|  | ||||
| if __name__ == "__main__": | ||||
|     turtle = umonsTurtle() | ||||
|     turtle.speed(0) | ||||
|     flocon(turtle, 100, 6, sides=4) | ||||
|     wait() | ||||
		Reference in New Issue
	
	Block a user