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 LF: Procedures in LOGO

Nov 122019
 

You may copy and paste code from these instructions to save time typing.

Start a new LOGO file
Type:
    reset
    setpensize 5

Copy the following PROCEDURE:

    to snowflake
    repeat 6 [fd 20 bk 20 rt 60]
    end

Now whenever you want to draw a snowflake, you just have to write snowflake  rather than typing all of the code for a snowflake.  The code above is called a PREOCEDURE – it teaches the computer a new word and what it means.

Try this

    snowflake
    repeat 10 [snowflake fd 20 rt 36]

Why did we use the numbers 10 (for repeat) and 36 (for the right turn)?

You can also add a VARIABLE to a procedure.  Change the snowflake procedure to this:

    to snowflake :size
    repeat 6 [fd :size bk :size rt 60]
    end

Now when you call snowflake, you need to put a number with it, which will be how big it is.

Try this:

snowflake 50

snowflake 100

You can add other variables to the snowflake too.  Change the procedure to this:

to snowflake :size :col :pensize
   colour :col
   setpensize :pensize    
   repeat 6 [fd :size bk :size rt 60]
end

Then type for example:   snowflake 60 “blue 10

Let’s make a snowstorm…

Copy this code:

repeat 100
[
pu setxy (250 – random 500) (250 – random 500) pd
snowflake random 50 “blue random 15
]

Now tinker, play, experiment…

You could add this after the reset: colour “blue fill then make your snowflakes white

  •  12th November 2019
  •  Posted by Mr W at 11:46 am
  •   Add comments
  •   News
  •  Tagged with: coding, j2code, LOGO, Y6, Y6T2

 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.

  Y5 LF:Use variables to draw different shapes   Y5 LF: Use variables to draw spirals

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