shalaby / Rainbow-Spiral---Python-Turtle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rainbow-Spiral - Python Turtle

Turtle:

“Turtle” is a python library which has a pointing device(turtle) and a canvas, which lets you command a turtle to make shapes. It is a useful library from which beginers can start with. It was part of the original Logo programming language developed by Wally Feurzeig, Seymour Papert and Cynthia Solomon in 1967.

Rainbow Spiral :

alt text

Turtle Methods Used:

  1. turtle.fd(distance) : Move the turtle forward by the specified distance, in the direction the turtle is headed.
  2. turtle.rt(angle) : Turn turtle right by angle units. (Units are by default degrees, but can be set via the degrees() and radians() functions.)
  3. turtle.pencolor(*args) : pencolor(r, g, b) - Set pencolor to the RGB color represented by r, g, and b. Each of r, g, and b must be in the range 0..colormode.
  4. turtle.bgcolor(*args) : args – a color string or three numbers in the range 0..colormode or a 3-tuple of such numbers, Set or return background color of the TurtleScreen.
  5. turtle.colormode(cmode=None) : cmode – one of the values 1.0 or 255, Return the colormode or set it to 1.0 or 255. Subsequently r, g, b values of color triples have to be in the range 0..cmode.
  6. turtle.title(titlestring) : titlestring – a string that is shown in the titlebar of the turtle graphics window, Set title of turtle window to titlestring.
  7. turtle.speed(speed=None) : speed – an integer in the range 0..10 or a speedstring, Set the turtle’s speed to an integer value in the range 0..10.

About


Languages

Language:Python 100.0%