SlideShare une entreprise Scribd logo
1  sur  10
Microsoft® Small Basic Turtle Graphics Estimated time to complete this lesson: 1 hour
Turtle Graphics In this lesson, you will learn about: Using the Turtle object to move the Turtle on the screen. Using the various properties and operations of the Turtle object to create graphics. Drawing colorful designs by using the Turtle object in For..EndFor loops.
Meet the Turtle  The Turtle is displayed on the screen. Meet your new friend in Small Basic—the Turtle! The Turtle helps you draw interesting graphics on the graphics window. You can display the Turtle by using the Show operation.  Click the               button on the toolbar.
Properties and Operations of the Turtle Object You can give commands to the Turtle by using the Turtle object. In turn, the Turtle draws graphics on the screen. Let’s look at some of these functions… To set the location of the Turtle on the screen, you can specify the x- and y-coordinates by using the X and Y properties of the Turtle object.  To move the Turtle for a particular distance, you can use the Move operation. Similarly, you can use the MoveTo operation, and specify the x- and y-coordinates of the location where you want the Turtle to move.  To draw with the Turtle, you use the PenDown operation. If you want the Turtle to stop drawing on the screen, use the PenUpoperation.
Properties and Operations of the Turtle Object Let’s have a look at some more functions… To set the speed of the Turtle, you use the Speed property. You can choose a value from 1 to 10, 1 being the slowest and 10 being the fastest. To turn the Turtle, use the Turn operation. When using this operation, you define an angle in degrees. Alternatively, you can also use the TurnRightandTurnLeftoperations, which turn the Turtle by 90 degrees to the right and left, respectively. To turn the Turtle by a specific angle of rotation, you can use the Angle property and define the angle of rotation in degrees. The default angle of the Turtle is 0 degrees. An angle of 0 degrees means the turtle is facing up on the screen.
Making the Turtle Move Let us start by making the Turtle draw a simple triangle on the screen. output Click the               button on the toolbar.
Having Fun with the Turtle Now that you know how to communicate with the Turtle, let’s use it for some fun activities. Let’s use the For loop and instruct the Turtle to move and turn at specific distances and angles, creating a unique graphical design in the process. You can use the PenColor property of the GraphicsWindow object to add color to your design.
Having Fun with the Turtle You can also use the Turtle to create multiple, colorful graphics on the screen. Let’s look at a program that provides our desired output. output
Let’s Summarize… Congratulations! Now you know how to: Use the Turtle object to move the Turtle on the screen. Use the various properties and operations of the Turtle object to create graphics. Draw colorful designs by using the Turtle object in For..EndFor loops.
It’s Time to Apply Your Learning… Write a program to display a Turtle and use it to draw colorful graphics by performing the following steps: ,[object Object]

Contenu connexe

Tendances

Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial之宇 趙
 
File Handling Python
File Handling PythonFile Handling Python
File Handling PythonAkhil Kaushik
 
Operators and Control Statements in Python
Operators and Control Statements in PythonOperators and Control Statements in Python
Operators and Control Statements in PythonRajeswariA8
 
Python/Flask Presentation
Python/Flask PresentationPython/Flask Presentation
Python/Flask PresentationParag Mujumdar
 
Python GUI Programming
Python GUI ProgrammingPython GUI Programming
Python GUI ProgrammingRTS Tech
 
Function arguments In Python
Function arguments In PythonFunction arguments In Python
Function arguments In PythonAmit Upadhyay
 
Operators in Python
Operators in PythonOperators in Python
Operators in PythonAnusuya123
 
Python Programming - XIII. GUI Programming
Python Programming - XIII. GUI ProgrammingPython Programming - XIII. GUI Programming
Python Programming - XIII. GUI ProgrammingRanel Padon
 
Django for Beginners
Django for BeginnersDjango for Beginners
Django for BeginnersJason Davies
 
Python - gui programming (tkinter)
Python - gui programming (tkinter)Python - gui programming (tkinter)
Python - gui programming (tkinter)Learnbay Datascience
 
Introduction to django framework
Introduction to django frameworkIntroduction to django framework
Introduction to django frameworkKnoldus Inc.
 
pandas - Python Data Analysis
pandas - Python Data Analysispandas - Python Data Analysis
pandas - Python Data AnalysisAndrew Henshaw
 
Arrays In Python | Python Array Operations | Edureka
Arrays In Python | Python Array Operations | EdurekaArrays In Python | Python Array Operations | Edureka
Arrays In Python | Python Array Operations | EdurekaEdureka!
 

Tendances (20)

Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial
 
File Handling Python
File Handling PythonFile Handling Python
File Handling Python
 
Introduction to Python
Introduction to Python  Introduction to Python
Introduction to Python
 
NUMPY
NUMPY NUMPY
NUMPY
 
Java: GUI
Java: GUIJava: GUI
Java: GUI
 
Operators and Control Statements in Python
Operators and Control Statements in PythonOperators and Control Statements in Python
Operators and Control Statements in Python
 
Python ppt
Python pptPython ppt
Python ppt
 
Python/Flask Presentation
Python/Flask PresentationPython/Flask Presentation
Python/Flask Presentation
 
Python GUI Programming
Python GUI ProgrammingPython GUI Programming
Python GUI Programming
 
Function arguments In Python
Function arguments In PythonFunction arguments In Python
Function arguments In Python
 
Python GUI
Python GUIPython GUI
Python GUI
 
Operators in Python
Operators in PythonOperators in Python
Operators in Python
 
Python Programming - XIII. GUI Programming
Python Programming - XIII. GUI ProgrammingPython Programming - XIII. GUI Programming
Python Programming - XIII. GUI Programming
 
Django for Beginners
Django for BeginnersDjango for Beginners
Django for Beginners
 
Python - gui programming (tkinter)
Python - gui programming (tkinter)Python - gui programming (tkinter)
Python - gui programming (tkinter)
 
Introduction to django framework
Introduction to django frameworkIntroduction to django framework
Introduction to django framework
 
pandas - Python Data Analysis
pandas - Python Data Analysispandas - Python Data Analysis
pandas - Python Data Analysis
 
Python
PythonPython
Python
 
Arrays In Python | Python Array Operations | Edureka
Arrays In Python | Python Array Operations | EdurekaArrays In Python | Python Array Operations | Edureka
Arrays In Python | Python Array Operations | Edureka
 
Python functions
Python functionsPython functions
Python functions
 

En vedette

2.1 graphics window
2.1   graphics window2.1   graphics window
2.1 graphics windowallenbailey
 
2.3 exploring shapes
2.3   exploring shapes2.3   exploring shapes
2.3 exploring shapesallenbailey
 
1.1 introduction to small basic
1.1   introduction to small basic1.1   introduction to small basic
1.1 introduction to small basicallenbailey
 
1.4 conditions and loops
1.4   conditions and loops1.4   conditions and loops
1.4 conditions and loopsallenbailey
 
Basic logo-command
Basic logo-commandBasic logo-command
Basic logo-commanddat298
 
In-bai tap logo_01 (hsinh)
  In-bai tap logo_01 (hsinh)  In-bai tap logo_01 (hsinh)
In-bai tap logo_01 (hsinh)saobiennt
 
Msw logo application user manual for teacher
Msw logo application user manual for teacherMsw logo application user manual for teacher
Msw logo application user manual for teacherfarah510
 
Logo primitives
Logo primitivesLogo primitives
Logo primitivessshaner88
 
In-bai tap logo_02 -thu tuc (gv)
  In-bai tap logo_02 -thu tuc (gv)  In-bai tap logo_02 -thu tuc (gv)
In-bai tap logo_02 -thu tuc (gv)saobiennt
 
Turtle graphics
Turtle graphicsTurtle graphics
Turtle graphicsgrahamwell
 
2.5 clock, desktop, and dictionary objects
2.5   clock, desktop, and dictionary objects2.5   clock, desktop, and dictionary objects
2.5 clock, desktop, and dictionary objectsallenbailey
 
1.5 branching and subroutines
1.5   branching and subroutines1.5   branching and subroutines
1.5 branching and subroutinesallenbailey
 
Second commandment
Second  commandmentSecond  commandment
Second commandmentMaria Ida Yu
 
First commandment
First commandmentFirst commandment
First commandmentrenzijonas
 

En vedette (20)

2.1 graphics window
2.1   graphics window2.1   graphics window
2.1 graphics window
 
2.3 exploring shapes
2.3   exploring shapes2.3   exploring shapes
2.3 exploring shapes
 
1.1 introduction to small basic
1.1   introduction to small basic1.1   introduction to small basic
1.1 introduction to small basic
 
1.4 conditions and loops
1.4   conditions and loops1.4   conditions and loops
1.4 conditions and loops
 
Basic logo-command
Basic logo-commandBasic logo-command
Basic logo-command
 
In-bai tap logo_01 (hsinh)
  In-bai tap logo_01 (hsinh)  In-bai tap logo_01 (hsinh)
In-bai tap logo_01 (hsinh)
 
Msw logo
Msw logoMsw logo
Msw logo
 
Msw logo application user manual for teacher
Msw logo application user manual for teacherMsw logo application user manual for teacher
Msw logo application user manual for teacher
 
Logo primitives
Logo primitivesLogo primitives
Logo primitives
 
Geometria de las Tortugas
Geometria de las  TortugasGeometria de las  Tortugas
Geometria de las Tortugas
 
In-bai tap logo_02 -thu tuc (gv)
  In-bai tap logo_02 -thu tuc (gv)  In-bai tap logo_02 -thu tuc (gv)
In-bai tap logo_02 -thu tuc (gv)
 
Logo
LogoLogo
Logo
 
Small basic
Small basicSmall basic
Small basic
 
Turtle graphics
Turtle graphicsTurtle graphics
Turtle graphics
 
La Tortuga Gráfica - Small Basic
La Tortuga Gráfica - Small BasicLa Tortuga Gráfica - Small Basic
La Tortuga Gráfica - Small Basic
 
2.5 clock, desktop, and dictionary objects
2.5   clock, desktop, and dictionary objects2.5   clock, desktop, and dictionary objects
2.5 clock, desktop, and dictionary objects
 
1.3 variables
1.3   variables1.3   variables
1.3 variables
 
1.5 branching and subroutines
1.5   branching and subroutines1.5   branching and subroutines
1.5 branching and subroutines
 
Second commandment
Second  commandmentSecond  commandment
Second commandment
 
First commandment
First commandmentFirst commandment
First commandment
 

Similaire à 2.2 turtle graphics

7.Advanced Scripts in Scratch.pptx
7.Advanced Scripts in Scratch.pptx7.Advanced Scripts in Scratch.pptx
7.Advanced Scripts in Scratch.pptxdipalishewale2
 
Star logo nova code cookbook
Star logo nova  code cookbookStar logo nova  code cookbook
Star logo nova code cookbookBarbara M. King
 
Star logo nova code cookbook(1)
Star logo nova  code cookbook(1)Star logo nova  code cookbook(1)
Star logo nova code cookbook(1)Barbara M. King
 
4.2 responding to events
4.2   responding to events4.2   responding to events
4.2 responding to eventsallenbailey
 
Std 11 Computer Chapter 2 Animation Tool: synfig (Part 2 Different Tools in ...
Std 11 Computer Chapter 2 Animation Tool:  synfig (Part 2 Different Tools in ...Std 11 Computer Chapter 2 Animation Tool:  synfig (Part 2 Different Tools in ...
Std 11 Computer Chapter 2 Animation Tool: synfig (Part 2 Different Tools in ...Nuzhat Memon
 
Scratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek panditScratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek panditBibekPandit2
 
1. production experiments
1. production experiments1. production experiments
1. production experimentsbronparsons
 
Scratch MIT Coding Basics
Scratch MIT Coding BasicsScratch MIT Coding Basics
Scratch MIT Coding BasicsProAryamanGamer
 
Alice01
Alice01Alice01
Alice01h2vs10
 
The Adventures of Mike, How to Use Scratch 2.0 to Program Your Game
The Adventures of Mike, How to Use Scratch 2.0 to Program Your GameThe Adventures of Mike, How to Use Scratch 2.0 to Program Your Game
The Adventures of Mike, How to Use Scratch 2.0 to Program Your GameUna Tao
 
2d game engine workflow
2d game engine workflow2d game engine workflow
2d game engine workflowluisfvazquez1
 
Sharepoint 2013 - un slider JSSOR sur bib Images
Sharepoint 2013 - un slider JSSOR sur bib ImagesSharepoint 2013 - un slider JSSOR sur bib Images
Sharepoint 2013 - un slider JSSOR sur bib ImagesEmmanuel Sotter
 

Similaire à 2.2 turtle graphics (20)

7.Advanced Scripts in Scratch.pptx
7.Advanced Scripts in Scratch.pptx7.Advanced Scripts in Scratch.pptx
7.Advanced Scripts in Scratch.pptx
 
Maya
MayaMaya
Maya
 
02 unity 3_d_part_1
02 unity 3_d_part_102 unity 3_d_part_1
02 unity 3_d_part_1
 
Star logo nova code cookbook
Star logo nova  code cookbookStar logo nova  code cookbook
Star logo nova code cookbook
 
Star logo nova code cookbook(1)
Star logo nova  code cookbook(1)Star logo nova  code cookbook(1)
Star logo nova code cookbook(1)
 
03 unity 3_d_part_2
03 unity 3_d_part_203 unity 3_d_part_2
03 unity 3_d_part_2
 
4.2 responding to events
4.2   responding to events4.2   responding to events
4.2 responding to events
 
Std 11 Computer Chapter 2 Animation Tool: synfig (Part 2 Different Tools in ...
Std 11 Computer Chapter 2 Animation Tool:  synfig (Part 2 Different Tools in ...Std 11 Computer Chapter 2 Animation Tool:  synfig (Part 2 Different Tools in ...
Std 11 Computer Chapter 2 Animation Tool: synfig (Part 2 Different Tools in ...
 
Scratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek panditScratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek pandit
 
1. production experiments
1. production experiments1. production experiments
1. production experiments
 
Scratch MIT Coding Basics
Scratch MIT Coding BasicsScratch MIT Coding Basics
Scratch MIT Coding Basics
 
Scratch Animation
Scratch AnimationScratch Animation
Scratch Animation
 
Alice01
Alice01Alice01
Alice01
 
Scratch Lesson 2
Scratch Lesson 2Scratch Lesson 2
Scratch Lesson 2
 
03 whack a-witch!
03 whack a-witch!03 whack a-witch!
03 whack a-witch!
 
Keynote
KeynoteKeynote
Keynote
 
How do i
How do iHow do i
How do i
 
The Adventures of Mike, How to Use Scratch 2.0 to Program Your Game
The Adventures of Mike, How to Use Scratch 2.0 to Program Your GameThe Adventures of Mike, How to Use Scratch 2.0 to Program Your Game
The Adventures of Mike, How to Use Scratch 2.0 to Program Your Game
 
2d game engine workflow
2d game engine workflow2d game engine workflow
2d game engine workflow
 
Sharepoint 2013 - un slider JSSOR sur bib Images
Sharepoint 2013 - un slider JSSOR sur bib ImagesSharepoint 2013 - un slider JSSOR sur bib Images
Sharepoint 2013 - un slider JSSOR sur bib Images
 

Plus de allenbailey

5.1 sharing code
5.1   sharing code5.1   sharing code
5.1 sharing codeallenbailey
 
4.4 advanced games
4.4   advanced games4.4   advanced games
4.4 advanced gamesallenbailey
 
4.3 collision detection
4.3   collision detection4.3   collision detection
4.3 collision detectionallenbailey
 
4.1 playing with shapes
4.1   playing with shapes4.1   playing with shapes
4.1 playing with shapesallenbailey
 
3.6 debugging aids
3.6   debugging aids3.6   debugging aids
3.6 debugging aidsallenbailey
 
3.5 the controls object
3.5   the controls object3.5   the controls object
3.5 the controls objectallenbailey
 
3.4 events and interactivity
3.4   events and interactivity3.4   events and interactivity
3.4 events and interactivityallenbailey
 
3.3 the math object
3.3   the math object3.3   the math object
3.3 the math objectallenbailey
 
3.2 stacks and arrays
3.2   stacks and arrays3.2   stacks and arrays
3.2 stacks and arraysallenbailey
 
3.1 file input and output
3.1   file input and output3.1   file input and output
3.1 file input and outputallenbailey
 
2.6 flickr, image list, and network objects
2.6   flickr, image list, and network objects2.6   flickr, image list, and network objects
2.6 flickr, image list, and network objectsallenbailey
 
2.4 sound, program, and text objects
2.4   sound, program, and text objects2.4   sound, program, and text objects
2.4 sound, program, and text objectsallenbailey
 
1.2 statements, properties, and operations
1.2   statements, properties, and operations1.2   statements, properties, and operations
1.2 statements, properties, and operationsallenbailey
 

Plus de allenbailey (13)

5.1 sharing code
5.1   sharing code5.1   sharing code
5.1 sharing code
 
4.4 advanced games
4.4   advanced games4.4   advanced games
4.4 advanced games
 
4.3 collision detection
4.3   collision detection4.3   collision detection
4.3 collision detection
 
4.1 playing with shapes
4.1   playing with shapes4.1   playing with shapes
4.1 playing with shapes
 
3.6 debugging aids
3.6   debugging aids3.6   debugging aids
3.6 debugging aids
 
3.5 the controls object
3.5   the controls object3.5   the controls object
3.5 the controls object
 
3.4 events and interactivity
3.4   events and interactivity3.4   events and interactivity
3.4 events and interactivity
 
3.3 the math object
3.3   the math object3.3   the math object
3.3 the math object
 
3.2 stacks and arrays
3.2   stacks and arrays3.2   stacks and arrays
3.2 stacks and arrays
 
3.1 file input and output
3.1   file input and output3.1   file input and output
3.1 file input and output
 
2.6 flickr, image list, and network objects
2.6   flickr, image list, and network objects2.6   flickr, image list, and network objects
2.6 flickr, image list, and network objects
 
2.4 sound, program, and text objects
2.4   sound, program, and text objects2.4   sound, program, and text objects
2.4 sound, program, and text objects
 
1.2 statements, properties, and operations
1.2   statements, properties, and operations1.2   statements, properties, and operations
1.2 statements, properties, and operations
 

Dernier

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 

Dernier (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

2.2 turtle graphics

  • 1. Microsoft® Small Basic Turtle Graphics Estimated time to complete this lesson: 1 hour
  • 2. Turtle Graphics In this lesson, you will learn about: Using the Turtle object to move the Turtle on the screen. Using the various properties and operations of the Turtle object to create graphics. Drawing colorful designs by using the Turtle object in For..EndFor loops.
  • 3. Meet the Turtle The Turtle is displayed on the screen. Meet your new friend in Small Basic—the Turtle! The Turtle helps you draw interesting graphics on the graphics window. You can display the Turtle by using the Show operation. Click the button on the toolbar.
  • 4. Properties and Operations of the Turtle Object You can give commands to the Turtle by using the Turtle object. In turn, the Turtle draws graphics on the screen. Let’s look at some of these functions… To set the location of the Turtle on the screen, you can specify the x- and y-coordinates by using the X and Y properties of the Turtle object. To move the Turtle for a particular distance, you can use the Move operation. Similarly, you can use the MoveTo operation, and specify the x- and y-coordinates of the location where you want the Turtle to move. To draw with the Turtle, you use the PenDown operation. If you want the Turtle to stop drawing on the screen, use the PenUpoperation.
  • 5. Properties and Operations of the Turtle Object Let’s have a look at some more functions… To set the speed of the Turtle, you use the Speed property. You can choose a value from 1 to 10, 1 being the slowest and 10 being the fastest. To turn the Turtle, use the Turn operation. When using this operation, you define an angle in degrees. Alternatively, you can also use the TurnRightandTurnLeftoperations, which turn the Turtle by 90 degrees to the right and left, respectively. To turn the Turtle by a specific angle of rotation, you can use the Angle property and define the angle of rotation in degrees. The default angle of the Turtle is 0 degrees. An angle of 0 degrees means the turtle is facing up on the screen.
  • 6. Making the Turtle Move Let us start by making the Turtle draw a simple triangle on the screen. output Click the button on the toolbar.
  • 7. Having Fun with the Turtle Now that you know how to communicate with the Turtle, let’s use it for some fun activities. Let’s use the For loop and instruct the Turtle to move and turn at specific distances and angles, creating a unique graphical design in the process. You can use the PenColor property of the GraphicsWindow object to add color to your design.
  • 8. Having Fun with the Turtle You can also use the Turtle to create multiple, colorful graphics on the screen. Let’s look at a program that provides our desired output. output
  • 9. Let’s Summarize… Congratulations! Now you know how to: Use the Turtle object to move the Turtle on the screen. Use the various properties and operations of the Turtle object to create graphics. Draw colorful designs by using the Turtle object in For..EndFor loops.
  • 10.
  • 11. Use the Turtle to draw two star-shaped graphics on the screen.
  • 12. Format the stars to be separate and colorful.

Notes de l'éditeur

  1. You have learned how to use the text window and the graphics window. You have also learned about various statements, properties, and operations. Now, meet your new friend in Small Basic—the Turtle. With the help of the Turtle, you can draw shapes and graphics on the screen. You can hide the Turtle by using the Hide operation.Code:Turtle.Show()
  2. When you click Run on the Toolbar or press F5 on the keyboard, the Turtle draws a colored, square graphical design on the screen.Code:GraphicsWindow.Title = "Turtle Graphics"GraphicsWindow.Height = 320GraphicsWindow.Width = 300GraphicsWindow.PenColor = "purple"Turtle.Show()Turtle.Speed = 8Turtle.X = 150Turtle.Y = 150For i = 0 To 200 Step 5 Turtle.Move(i) Turtle.Turn(90)EndFor
  3. Solution: GraphicsWindow.Height = 400GraphicsWindow.Width = 400GraphicsWindow.Title = "Turtle Graphics"Turtle.Show()Turtle.Speed = 10Turtle.X = 100Turtle.Y = 200For i = 0 To 200 Step 5 GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor()Turtle.Move(i) Turtle.Turn(150)EndForTurtle.PenUp()Turtle.Move(300)Turtle.Turn(105)Turtle.Move(150)Turtle.PenDown()For i = 0 To 200 Step 5 GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor()Turtle.Move(i) Turtle.Turn(150)EndFor