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

Y5 LF Use random code!

Nov 302021
 

Recap

  • What is a procedure?
  • How do we code a procedure?
  • What is a procedure with variables?

New skill

  • random 100 = chooses a number between 1 and 50
  • So typing “c random 100” draws a c which is between 1 and 100 big
  • setpensize rnadom 30 chooses a pen width between 1 and 30
  • If you c had two variables, then you could type:
    • c random 100 random 30
  • The coordinates on the drawing canvas go from -250 to 250 across and -250 to 250 up and down.  (0,0) is in the middle.
  • To make your shape appear in a random place:
    • setxy (-250 + random 500)  (-250 + random 500)

Tasks

  1. Open you “c size procedure” file
  2. Add the following code to make lots of random c shapes
    1. repeat 100
    2. [
    3. c random 100 random 30
    4. pu
    5. setxy  (-250 + random 500)  (-250 + random 500)
    6. pd
    7. ]
  3. ** Put this line inside the repeat to get random colours!
    1. colour [random 255 random 255 random 255]
  4. ** Write your own letter procedure with a variable :size instead of fd/bk numbers
  5. *** Can you include a :col variable to choose the colour?
  6. How else could you use random?  Try these ideas on different files
    1. circle random 100
    2. repeat 100 [fd random 100 rt 90]
    3. repeat 100 [fd random 200 setxy 0 0 rt 5]

See these posts for more ideas and techniques:

  • Draw letter rainbows, flowers and shapes
  • Stars and shapes 2
  • Stars and shapes 1
  • The power of procedures with variables
  • Use variables to draw spirals
  • Use variables to draw shapes
  • Random
  • Repeat, setxy, procedures

LOGO example files – can you work out how they work?

  • Letter procedures
  • Rectangle four variables
  • Random colour wheel
  • Spiral code
  • Another spiral
  •  30th November 2021
  •  Posted by Mr W at 7:27 pm
  •   Add comments
  •   News
  •  Tagged with: coding, j2code, LOGO, Y5, Y5T2

 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 Make procedures with variables   Townscaper – build an island town

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