Microsoft® Small Basic

Slides:



Advertisements
Similar presentations
First of all – lets look at the windows you are going to use. At the top you have a toolbar, with all your various tools you can use when customising your.
Advertisements

Microsoft® Small Basic
Objectives Build and modify an organization chart.
Microsoft® Small Basic Graduating to the Microsoft Visual Basic® development environment Estimated time to complete this lesson: 1 hour.
Microsoft® Small Basic Statements, Properties, and Operations Estimated time to complete this lesson: 1 hour.
Microsoft® Small Basic
Microsoft® Small Basic
Microsoft® Small Basic
Microsoft® Small Basic Advanced Games Estimated time to complete this lesson: 1 hour.
Microsoft® Small Basic Debugging Aids Estimated time to complete this lesson: 1 hour.
Microsoft® Small Basic Clock, Desktop, and Dictionary Objects Estimated time to complete this lesson: 1 hour.
Super Logo. Key Instructions Pendown penup Forward 50 ( this number can change) Right 90 ( this number can change as well) Now try and draw a Early finishers,
EIGHTH GRADE ROBOTICS KITTATINNY REGIONAL HIGH SCHOOL MR. SHEA Introduction to Programming
1 Python Programming: An Introduction to Computer Science Chapter 3 Objects and Graphics.
Programming in Python Turtle Graphics Dr. Kristine Nagel Genie Yang Raquel Lawrence Dr. Kristine Nagel Genie Yang Raquel Lawrence Georgia Gwinnett College.
CS&E 1111 PowerPoint Microsoft PowerPoint Learning about Presentation Software and using Microsoft PowerPoint Slide views Preparing text, drawings and.
Introduction to TouchDevelop
Microsoft® Small Basic The Math Object Estimated time to complete this lesson: 1 hour.
Microsoft® Small Basic Sharing Code Estimated time to complete this lesson: 1 hour.
Turtle Graphics  Turtle graphics provide a simple way to draw pictures in a window.  The name suggests the way in which we can think about the drawing.
Microsoft® Small Basic Clock, Desktop, and Dictionary Objects Estimated time to complete this lesson: 1 hour.
Creating a MagicInfo Pro Screen Template
Microsoft® Small Basic The Controls Object Estimated time to complete this lesson: 1 hour.
1 ADVANCED MICROSOFT WORD Lesson 15 – Creating Forms and Working with Web Documents Microsoft Office 2003: Advanced.
XP Tutorial 7 New Perspectives on Microsoft Windows XP 1 Microsoft Windows XP Working with Graphics Tutorial 7.
Microsoft® Small Basic
LOGO SOFTWARE BY: SAVE 9S. INTRODUCTION Logo is a software that can be found at : Shared area> High School > ICT > take home software > LOGO32. This is.
Geometers Sketch pad. Step 1: Open Sketch pad Use this to select items Use this to draw a point Use this to draw a circle Use this to draw a line Use.
Object-Oriented Programming. Object-oriented programming  First goal: Define and describe the objects of the world  Noun-oriented  Focus on the domain.
What is AutoCAD? A software drafting tool Particularly useful for Mechanical drawings Architectural drawings.
Getting Started With AutoCAD ENGR 2 Week #1 Laboratory.
Instructor’s Guide to Teaching SolidWorks Software Lesson 1 School’s Name Teacher’s Name Date.
1 CSC 221: Computer Programming I Fall 2011 Fun with turtle graphics  turtle module  relative motion (setup, reset, left, right, forward, backward) 
Turtle Graphics  Turtle graphics provide a simple way to draw pictures in a window.  The name suggests the way in which we can think about the drawing.
1 Turtle Graphics and Math Functions And how you can use them to draw cool pictures!
TURTLE GRAPHICS IP MR. MELLESMOEN. LOGO IN THE 1970’S THERE WAS A SIMPLE BUT POWERFUL PROGRAMMING LANGUAGE CALLED LOGO THAT WAS USED BY A FEW.
Introduction to TouchDevelop
Hello, little turtles. Hello, little turtles! There are many modules in Python that provide very powerful feature that we can use in our own program.
Logo For beginners By Dali Matthews 9S What is logo?
An introduction to Logo Mike Warriner Engineering Director, Google Note: This course is not an endorsement of Logo by Google. All views in this document.
Floor Plans in Microsoft Excel Models for the 21 st Century Architect/Engineer By: Mrs. Guenther.
1 Building Your Own Turtle Functions For making really cool pictures!
Visual Basic.NET BASICS Lesson 1 A First Look at Microsoft Visual Basic.NET.
Microsoft® Small Basic Collision Detection Estimated time to complete this lesson: 1 hour.
Loops & Graphics IP 10 Mr. Mellesmoen Recall Earlier we wrote a program listing numbers from 1 – 24 i=1 start: TextWindow.WriteLine(i) i=i+1 If.
Microsoft Visual Basic 2005 BASICS Lesson 1 A First Look at Microsoft Visual Basic.
1 Building Your Own Turtle Functions For making really cool pictures!
Microsoft® Small Basic Exploring Shapes Estimated time to complete this lesson: 1 hour.
CRE Programming Club - Class 5 Robert Eckstein and Robert Heard.
Microsoft® Small Basic Flickr, ImageList, and Network Objects Estimated time to complete this lesson: 1 hour.
Microsoft® Small Basic Conditions and Loops Estimated time to complete this lesson: 2 hours.
Turtle Graphics Let’s see what we can draw on Python!
Turtle Graphics Lesson 2 1. There are 3 homeworks to complete during the six lessons of this unit. Your teacher will let you know when a homework has.
Visual Basic.NET BASICS Lesson 14 Menus and Printing.
Introducing the turtle
Hackety Hack! Written by Krystal Salerno Presented by _______________.
Using the Python Turtle
Graphics CIS 40 – Introduction to Programming in Python
Microsoft® Small Basic
Microsoft® Small Basic
Starter Write a program that asks the user if it is raining today.
A Tiny Look at the Graphics Window
Microsoft® Small Basic
البرمجة مع لغة PYTHON TURTLE
Microsoft® Small Basic
Hour of Code.
A few tricks to take you beyond the basics of Microsoft Office
Introduction to Turtle Graphics
A Tiny Look at the Graphics Window
Logo Programming.
Presentation transcript:

Microsoft® Small Basic Turtle Graphics Estimated time to complete this lesson: 1 hour

Turtle Graphics In this lesson, you will learn about: Moving the Turtle on the screen by using the Turtle object. Creating graphics by using the various properties and operations of the Turtle object. Drawing colorful designs by using the Turtle object in For..EndFor loops.

You can display the Turtle by using the Show operation. Meet the Turtle Meet your new friend in Small Basic—the Turtle! The Turtle helps you draw interesting graphics in the graphics window. You can display the Turtle by using the Show operation. Click on the toolbar. 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 its help, you can draw shapes and graphics on the screen. You can hide the Turtle by using the Hide operation. Code: Turtle.Show() The Turtle appears on the screen.

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 use the X and Y properties of the Turtle object. To move the Turtle a particular distance in pixels, you use the Move operation. To move the Turtle to a particular location, you use the MoveTo operation and its parameters to specify the new location. To specify the location at which the Turtle appears or a location to which the Turtle moves, you include the x-coordinate and the y-coordinate of the location that you want. Code: Turtle.X = 50 Turtle.Y = 200 Turtle.Move(150) Turtle.MoveTo(50, 200) Turtle.PenUp() Turtle.PenDown() To draw with the Turtle, you use the PenDown operation. To stop drawing with the Turtle, you use the PenUp operation.

Properties and Operations of the Turtle Object Let’s look at more functions… You can set the speed of the Turtle by using the Speed property and specifying a value between 1 and 10. (To see the Turtle’s fastest speed, specify 10.) You can rotate the Turtle by using the Turn operation and specifying an angle in degrees. As an alternative, you can rotate the Turtle 90 degrees by using the TurnRight or TurnLeft operations, respectively. You can rotate the Turtle to face a particular direction by specifying a value for the Angle property, by using the Turn operation, or by using the TurnRight or TurnLeft operation. For example, you can rotate the Turtle to face the left side of the window by using any of the following strategies: --You can specify the value of the Angle property as 270. --You can use the Turn operation and specify the following values for its parameter: --270 if the Turtle is already facing the top of the window --180 if the Turtle is already facing the right side of the window --90 if the Turtle is already facing the bottom of the window If you use this operation, the Turtle always rotates to the right (in a clockwise direction). --You can use the TurnRight operation three times if the Turtle is facing the top of the window, twice if the Turtle is facing the right side of the window, or once if the Turtle is facing the bottom of the window. --You can use the TurnLeft operation once if the Turtle is facing the top of the window, twice if the Turtle is facing the right side of the window, or three times if the Turtle is facing the bottom of the window. Code: Turtle.Speed = 8 Turtle.Turn(90) Turtle.TurnLeft() Turtle.TurnRight() Turtle.Angle = 90 You can turn the Turtle to a specific angle of rotation by using the Angle property and specifying the angle of rotation in degrees. By default, the Turtle faces the top of the screen, which is an angle of 0 degrees.

Making the Turtle Move Let’s draw a simple triangle by using the Turtle. Click on the toolbar. output In this example, the Turtle draws a simple triangle on the screen. Let’s understand the code in detail: In the first three lines of code, you set the width, height, and title of the graphics window. In the next two lines of code, you make the Turtle appear at a specific location in the graphics window. To specify the location, you set the value of the X property to a particular number of pixels from the left side of the graphics window, and you set the Y property to a particular number of pixels from the top of the graphics window. You then set the speed at which the Turtle moves by specifying a value between 1 and 10 (inclusive) for the Speed property. To make the Turtle move at its fastest speed, specify 10. To make the Turtle move at its slowest speed, specify 1. To make the Turtle draw the vertical side of the triange, you use the Move operation to instruct the Turtle to draw 150 pixels from its original location and in its default direction (up). By default, the Turtle draws when you use the Move operation. If you want the Turtle to move without drawing, you use the PenUp operation. To make the Turtle draw the horizontal side of the triangle, you first use the Turn operation to rotate the Turtle 90 degrees so that it faces the right side of the window. Then you use the Move operation to instruct the Turtle to draw 150 pixels from its new location and in its new direction. To make the Turtle draw the diagonal side of the triangle, you use the MoveTo operation and specify a location in the window. To specify the location, you set the value of the X property to a particular number of pixels from the left side of the graphics window, and you set the value of the Y property to a particular number of pixels from the top of the graphics window. Now that the triangle is complete, you rotate the Turtle by setting the value of the Angle property to 45 degrees. Code: GraphicsWindow.Width = 250 GraphicsWindow.Height = 250 GraphicsWindow.Title = "Turtle Graphics" Turtle.X = 50 Turtle.Y = 200 Turtle.Speed = 5 Turtle.Move(150) Turtle.Turn(90) Turtle.MoveTo(50, 200) Turtle.Angle = 45

Having Fun with the Turtle Now that you know how to communicate with the Turtle, let’s have some fun with it. 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. When you click Run on the toolbar or press F5 on the keyboard, the Turtle draws a colored, square design in the graphics window. Code: GraphicsWindow.Title = "Turtle Graphics" GraphicsWindow.Height = 320 GraphicsWindow.Width = 300 GraphicsWindow.PenColor = "Purple" Turtle.Show() Turtle.Speed = 8 Turtle.X = 150 Turtle.Y = 150 For i = 0 To 200 Step 5 Turtle.Move(i) Turtle.Turn(90) EndFor You can add color to your design by specifying a value for the PenColor property of the GraphicsWindow object.

Having Fun with the Turtle You can also draw multiple, colorful designs by using the Turtle. For example, this program produces different shapes in a variety of sizes and colors. output In the previous example, we drew one set of nested squares of the same color. However, you can draw more than one shape in the same graphics window by using the PenUp and PenDown operations. You can also create nested versions of different shapes, such as triangles, by assigning a For loop and changing the distance and the angles. In addition, you can also create shapes in a variety of colors by using the GetRandomColor operation to set the value of the PenColor property. When you click Run on the toolbar or press F5 on the keyboard, the Turtle draws two colorful designs in the graphics window. Code: GraphicsWindow.Title = "Turtle Graphics" GraphicsWindow.Height = 300 GraphicsWindow.Width = 500 Turtle.Show() Turtle.Speed = 10 Turtle.X = 150 Turtle.Y = 150 For i = 0 To 200 Step 5 GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor() Turtle.Move(i) Turtle.Turn(90) EndFor Turtle.PenUp() Turtle.Move(260) Turtle.Turn(60) Turtle.Move(120) Turtle.PenDown() Turtle.Turn(120)

Let’s Summarize… Congratulations! Now you know how to: Make the Turtle appear, move, and stop moving. Create shapes by using various properties and operations of the Turtle object. Draw colorful designs by using the Turtle object in For..EndFor loops.

Show What You Know Perform the following steps to draw colorful graphics by using the Turtle: Display a graphics window that is 400 pixels high and 400 pixels wide. Draw two separate, colorful star- shaped graphics by using the Turtle. Solution:   GraphicsWindow.Height = 400 GraphicsWindow.Width = 400 GraphicsWindow.Title = "Turtle Graphics" Turtle.Show() Turtle.Speed = 10 Turtle.X = 100 Turtle.Y = 200 For i = 0 To 200 Step 5 GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor() Turtle.Move(i) Turtle.Turn(150) EndFor Turtle.PenUp() Turtle.Move(300) Turtle.Turn(105) Turtle.Move(150) Turtle.PenDown()