@@ -210,7 +210,7 @@ def forward(self, distance):
210
210
211
211
def backward (self , distance ):
212
212
"""Move the turtle backward by distance, opposite to the direction the turtle is headed.
213
- Does not change the turtle’ s heading.
213
+ Does not change the turtle' s heading.
214
214
215
215
:param distance: how far to move (integer or float)
216
216
"""
@@ -220,7 +220,7 @@ def backward(self, distance):
220
220
back = backward
221
221
222
222
def degrees (self , fullcircle = 360 ):
223
- """Set angle measurement units, i.e. set number of “ degrees” for a full circle.
223
+ """Set angle measurement units, i.e. set number of " degrees" for a full circle.
224
224
Default value is 360 degrees.
225
225
226
226
:param fullcircle: the number of degrees in a full circle
@@ -256,7 +256,7 @@ def goto(self, x1, y1=None):
256
256
"""If y1 is None, x1 must be a pair of coordinates or an (x, y) tuple
257
257
258
258
Move turtle to an absolute position. If the pen is down, draw line.
259
- Does not change the turtle’ s orientation.
259
+ Does not change the turtle' s orientation.
260
260
261
261
:param x1: a number or a pair of numbers
262
262
:param y1: a number or None
@@ -324,7 +324,7 @@ def goto(self, x1, y1=None):
324
324
setposition = goto
325
325
326
326
def setx (self , x ):
327
- """Set the turtle’ s first coordinate to x, leave second coordinate
327
+ """Set the turtle' s first coordinate to x, leave second coordinate
328
328
unchanged.
329
329
330
330
:param x: new value of the turtle's x coordinate (a number)
@@ -333,7 +333,7 @@ def setx(self, x):
333
333
self .goto (x , self .pos ()[1 ])
334
334
335
335
def sety (self , y ):
336
- """Set the turtle’ s second coordinate to y, leave first coordinate
336
+ """Set the turtle' s second coordinate to y, leave first coordinate
337
337
unchanged.
338
338
339
339
:param y: new value of the turtle's y coordinate (a number)
@@ -359,7 +359,7 @@ def setheading(self, to_angle):
359
359
seth = setheading
360
360
361
361
def home (self ):
362
- """Move turtle to the origin – coordinates (0,0) – and set its heading to
362
+ """Move turtle to the origin - coordinates (0,0) - and set its heading to
363
363
its start-orientation
364
364
(which depends on the mode, see mode()).
365
365
"""
@@ -368,7 +368,7 @@ def home(self):
368
368
369
369
def circle (self , radius , extent = None , steps = None ):
370
370
"""Draw a circle with given radius. The center is radius units left of
371
- the turtle; extent – an angle – determines which part of the circle is
371
+ the turtle; extent - an angle - determines which part of the circle is
372
372
drawn. If extent is not given, draw the entire circle. If extent is not
373
373
a full circle, one endpoint of the arc is the current pen position.
374
374
Draw the arc in counterclockwise direction if radius is positive,
@@ -414,7 +414,7 @@ def clearstamp(self, stampid):
414
414
raise NotImplementedError
415
415
416
416
def clearstamps (self , n = None ):
417
- """Delete all or first/last n of turtle’ s stamps. If n is None, delete
417
+ """Delete all or first/last n of turtle' s stamps. If n is None, delete
418
418
all stamps, if n > 0 delete first n stamps, else if n < 0 delete last
419
419
n stamps.
420
420
@@ -430,17 +430,17 @@ def undo(self):
430
430
raise NotImplementedError
431
431
432
432
def speed (self , speed = None ):
433
- """Set the turtle’ s speed to an integer value in the range 0..10. If no
433
+ """Set the turtle' s speed to an integer value in the range 0..10. If no
434
434
argument is given, return current speed.
435
435
436
436
If input is a number greater than 10 or smaller than 0.5, speed is set
437
437
to 0. Speedstrings are mapped to speedvalues as follows:
438
438
439
- “ fastest” : 0
440
- “ fast” : 10
441
- “ normal” : 6
442
- “ slow” : 3
443
- “ slowest” : 1
439
+ " fastest" : 0
440
+ " fast" : 10
441
+ " normal" : 6
442
+ " slow" : 3
443
+ " slowest" : 1
444
444
445
445
Speeds from 1 to 10 enforce increasingly faster animation of line
446
446
drawing and turtle turning.
@@ -457,12 +457,12 @@ def speed(self, speed=None):
457
457
####################
458
458
# Tell turtle's state
459
459
def pos (self ):
460
- """Return the turtle’ s current location (x,y) (as a Vec2D vector)."""
460
+ """Return the turtle' s current location (x,y) (as a Vec2D vector)."""
461
461
return Vec2D (self ._x - self ._w // 2 , self ._h // 2 - self ._y )
462
462
position = pos
463
463
464
464
def clear (self ):
465
- """Delete the turtle’ s drawings from the screen. Do not move turtle.
465
+ """Delete the turtle' s drawings from the screen. Do not move turtle.
466
466
State and position of the turtle as well as drawings of other turtles
467
467
are not affected.
468
468
"""
@@ -478,24 +478,24 @@ def clear(self):
478
478
time .sleep (0.1 )
479
479
480
480
def heading (self ):
481
- """Return the turtle’ s current heading (value depends on the turtle mode, see mode())."""
481
+ """Return the turtle' s current heading (value depends on the turtle mode, see mode())."""
482
482
return self ._heading
483
483
484
484
# Pen control
485
485
def pendown (self ):
486
- """Pull the pen down – drawing when moving."""
486
+ """Pull the pen down - drawing when moving."""
487
487
self ._penstate = True
488
488
pd = pendown
489
489
down = pendown
490
490
491
491
def penup (self ):
492
- """Pull the pen up – no drawing when moving."""
492
+ """Pull the pen up - no drawing when moving."""
493
493
self ._penstate = False
494
494
pu = penup
495
495
up = penup
496
496
497
497
def isdown (self ):
498
- """Return True if pen is down, False if it’ s up."""
498
+ """Return True if pen is down, False if it' s up."""
499
499
return self ._penstate
500
500
501
501
def pencolor (self , c = None ):
@@ -514,13 +514,13 @@ def pencolor(self, c=None):
514
514
515
515
def mode (self , mode = None ):
516
516
"""
517
- Set turtle mode (“ standard”, “ logo” or “ world” ) and perform reset.
517
+ Set turtle mode (" standard", " logo" or " world" ) and perform reset.
518
518
If mode is not given, current mode is returned.
519
519
520
- Mode “ standard” is compatible with old turtle.
521
- Mode “ logo” is compatible with most Logo turtle graphics.
520
+ Mode " standard" is compatible with old turtle.
521
+ Mode " logo" is compatible with most Logo turtle graphics.
522
522
523
- :param mode: one of the strings “ standard” or “ logo"
523
+ :param mode: one of the strings " standard" or " logo"
524
524
"""
525
525
if mode == "standard" :
526
526
self ._logomode = False
0 commit comments