MrW's Computing Blog

Lessons and links for Computing at St Mark's
  • News
    • Termly Overviews
  • ONLINE SAFETY
    • ICT agreement
    • Online safety videos and podcasts
    • Online safety links
  • Forms
    • Online Safety Survey 25
    • How did that go?
    • Questions
    • My Computing Skills
    • How do I…?
    • Info form
    • End of unit reflection
  • Logins
    • Typing.com
    • J2launch
    • Google Classroom
    • Google Apps
  • Resources
    • LOGO programming
    • Child friendly search engines
    • Great comments
    • Keyboard, mouse and typing skills
    • Music for media projects
    • Video tutorials
    • How to blog
    • BBC bitesize computing
    • Doorway Online
    • LOGO activities
      • LOGO tutorial videos
    • Useful tools
    • Other stuff
      • Memory training
    • Scratch game toolkit 1
  • MrWs Maths
    • Y4 Multiplication Check
    • Times |Tables.co.uk
  • Galleries
    • Animations gallery
    • Audio Gallery
    • Film gallery
    • j2e gallery
    • LOGO gallery
    • Presentation gallery
    • Robot gallery
    • eSafety gallery
    • Scratch gallery
    • Showcase blog
  • Values for learning
  • Contact me
  • Parents
  • Mr W’s DT Blog

Y6 How do I use repeat, setxy and procedures in LOGO?

Nov 242017
 

Start a new project with the following and save it as “y6logo 2”

  • reset
  • setpensize 5

Repeat task

  1. repeat 4 [fd 40 rt 90] draws a square:
    1. the instructions inside the [] “fd 40 rt 90” are the ones to do again and again
    2. the “4” means repeat it four times
  2. Copy the code above to draw a square
  3. Copy and paste the code again
  4. Try changing the 4 to a 5.  What happens?
  5. Now change the “rt 90” to “rt 72”
  6. Copy the code again
  7. Try changing repeat to 6 – what should the “rt” number be?
  8. Now try repeat 7: when you draw the shape, the total angle turned is 360 because it comes back to the beginning.  It has 7 equal angles so each angle needs to be….360…7
  9. Copy the code again
  10. Draw an Octagon (8-sided) and a Nonagon (9-sided)
  11. Save (if you haven’t already!)

Finished?  You should have on your page:

  1. A square, pentagon, hexagon, heptagon, octagon and nonagon

Setxy

  1. Setxy is used to move the arrow to a different position on the canvas
  2. setxy 50 100 sends the arrow to the coordinates (50, 100)
  3. This Scratch project shows you what the different coordinates are:
    1. x y coordinate finder (only goes up to 240/180 in Scratch – in LOGO it goes up to 250 on each axis)
  4. NOTE if the pen is down, it will draw a line to the new position – so it is quite useful to use with pu and pd:
    1. pu setxy 50 100 pd – will send it to the new place without drawing then is ready to draw
  5. Use “pu setxy …. pd” to move your shapes from the first section to different places on the canvas.

Procedures

  1. Procedures are used to avoid typing the same thing several times.
  2. Use a procedure if you need to repeat something in your picture, eg windows in a house, snowflakes, stars, a fence, stripes, eyes….
  3. A procedure teaches the computer how to do a shape but doesn’t draw it.  Then you “call” the procedure to make it draw it.
  4. Instead of “repeat 4 [fd 40 rt 90]” at the beginning of your code, have this:

to square
repeat 4 [fd 40 rt 90]
end

  1. When you play, it will not draw the square – you have only told it how to – not to actually draw it.
  2. Now type “square”  after the procedure and it should draw the square.  You have taught it how to draw a square!
  3. Procedure are usually all at the beginning of the code.
  4. Make procedures called “pentagon” and “hexagon”
  5. Instead of drawing one pentagon, use the code:  repeat 6 [pentagon rt 60] to make a pentagon flower!
  6. Make a procedure to fill your shape:
    1. to fillshape
      1. pu rt 45 fd 10
      2. fill
      3. bk 10 lt 45 pd
    2. end
  7. Call the procedure after each shape you do.

Variables

Lists

 

Success steps

  • Save (as) different versions
  • Experiment with new code
  • Find your own mistakes by reading your code carefully
  • Use repeat, setxy and procedures in your own code

download

  •  24th November 2017
  •  Posted by Mr W at 7:00 am
  •   Add comments
  •   News
  •  Tagged with: LOGO, procedure, repeat, setxy, Y6

 Leave a Reply Cancel reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Y34 How do I use repeat in LOGO?   Y6 How do I create my project in LOGO?

Years and terms

T1 T2 T3 T4 T5 T6
Y3 Y3T1 Y3T2 Y3T3 Y3T4 Y3T5 Y3T6
Y4 Y4T1 Y4T2 Y4T3 Y4T4 Y4T5 Y4T6
Y5 Y5T1 Y5T2 Y5T3 Y5T4 Y5T5 Y5T6
Y6 Y6T1 Y6T2 Y6T3 Y6T4 Y6T5 Y6T6

 

Tags

animate coding CoronaVirus create creative data database DTP Google hyperlinks iMovie Internet iPad j2code j2e j2e5 j2e101 JIT JIT5 LOGO maths Music science scratch sliding block puzzles Y3 Y3T2 Y3T4 Y3T6 Y4 Y4T1 Y4T3 Y4T5 Y4T6 Y5 Y5T1 Y5T2 Y5T3 Y5T5 Y6 Y6T1 Y6T2 Y6T3 Y6T4 Y6T5

St Mark’s website

Recent Posts

  • Y4 Scratch maze
  • Y5 How can I create an effective book cover?
  • Y6 Last Computing session
  • ICT quizzes
  • Logic puzzles

Who has visited our site?

Flag Counter

See the Space Station!

Log in
© 2020 MrW's Computing Blog Suffusion theme by Sayontan Sinha