Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
EGN-1002 Introduction to Scratch Introduction to Scratch • • • • Intro to visual programming environment Intro to programming with multimedia Story-telling, music-making, game-making Intro to programming concepts: objects, attributes, sequence, repetition, conditions, events, I/O Instructor: Dr. Vlasov Lecture is licensed under a Creative Commons Attribution 2.0 License. Slide: 1 EGN-1002 Introduction to Scratch What is Scratch Scratch is a free programmable toolkit that enables users to create their own games, animated stories, and interactive art and share their creations with one another over the Internet. Use of scratch allows you to: • Create solutions to problems using computers • Study information • Invent algorithms • Write programs to implement the algorithms • Reuse a lot of existing program and machine parts Instructor: Dr. Vlasov Lecture is licensed under a Creative Commons Attribution 2.0 License. Slide: 2 EGN-1002 Start Scratch Introduction to Scratch • Open web browser • Navigate to: http://scratch.mit.edu Instructor: Dr. Vlasov Lecture is licensed under a Creative Commons Attribution 2.0 License. Slide: 3 EGN-1002 Introduction to Scratch Scratch start window Stage area Scripts area This is where the result of your program execution will be seen Blocks palette Your construct your script here by putting together command blocks from the “Blocks palette”. Sprite list List of existing or created objects which are used in your script. Instructor: Dr. Vlasov Lecture is licensed under a Creative Commons Attribution 2.0 License. Slide: 4 EGN-1002 What Scratch can do Introduction to Scratch • Can make cartoons • Can create stories • Can create video games Elements of Scratch: objects • • • • • • • Instructor: Dr. Vlasov Colors Sounds Locations in 2D space Sprites Costumes Variables (to remember the state of things) Events: that are broadcast for communication Lecture is licensed under a Creative Commons Attribution 2.0 License. Slide: 5 EGN-1002 Your first script Introduction to Scratch • Make sure to have a sprite selected in the “Sprite list” • Drag shown blocks into “Script area”. • Click the sprite in the “Stage area” Instructor: Dr. Vlasov Lecture is licensed under a Creative Commons Attribution 2.0 License. Slide: 6 EGN-1002 Introduction to Scratch Add new stage Instructor: Dr. Vlasov Lecture is licensed under a Creative Commons Attribution 2.0 License. Slide: 7 EGN-1002 Introduction to Scratch Stage dimensions These are x- and y- coordinates for the stage: y x = -240 y = 180 x = 240 y = 180 x x=0 y=0 x = 240 y = -180 x = -240 y = -180 Instructor: Dr. Vlasov Lecture is licensed under a Creative Commons Attribution 2.0 License. Slide: 8 EGN-1002 Introduction to Scratch Add new sprite Instructor: Dr. Vlasov Lecture is licensed under a Creative Commons Attribution 2.0 License. Slide: 9 EGN-1002 Loop constructs in Scratch Introduction to Scratch • Repeat N times • Repeat forever • Repeat forever if some condition exists Instructor: Dr. Vlasov Lecture is licensed under a Creative Commons Attribution 2.0 License. Slide: 10 EGN-1002 Introduction to Scratch Compose program in Scratch Instructor: Dr. Vlasov Lecture is licensed under a Creative Commons Attribution 2.0 License. Slide: 11 EGN-1002 Introduction to Scratch Compose scripts in Scratch Examples of loops and “IF” operators: Instructor: Dr. Vlasov Lecture is licensed under a Creative Commons Attribution 2.0 License. Slide: 12 EGN-1002 Introduction to Scratch Scratch assignment No. 1 Using Scratch (scratch.mit.edu) design algorithm and script which would perform the following: 1. Draw a car. 2. Draw a smiley face. 3. Draw a house. 4. Draw a sailboat. 5. Draw initials of the team leader. 6. Draw a robot face 7. Draw a 6-leaf flower 8. Draw 5 squares with crosses • Save your script on your local computer. • Prepare brief printed MS-Word report with problem statement, solution description, working script, and Scratch screen shots. • Upload the script and the report to your group file exchange section on the BlackBoard. • Each team should be able to present (show on the screen) and explain working scripts to the audience in class. • The printed report shall be turned in. Instructor: Dr. Vlasov Lecture is licensed under a Creative Commons Attribution 2.0 License. Slide: 13 EGN-1002 Introduction to Scratch Scratch assignment No. 2 Using Scratch (scratch.mit.edu) design algorithm and script which would display: 1. working digital clock 2. working analog clock 3. stop watch Create your own sprites and your own background if needed. • Save your script on your local computer. • Prepare brief printed MS-Word report with problem statement, solution description, working script, and Scratch screen shots. • Upload the script and the report to your group file exchange section on the BlackBoard. • Each team should be able to present (show on the screen) and explain working scripts to the audience in class. • The printed report shall be turned in. Instructor: Dr. Vlasov Lecture is licensed under a Creative Commons Attribution 2.0 License. Slide: 14 EGN-1002 Introduction to Scratch Scratch assignment No. 3 Using Scratch (scratch.mit.edu) design algorithm and script which would draw a graph of function: f(x) = A sin(ax + b) where A, a, and b are parameters which can be entered from keyboard. Create your own sprites and your own background if needed. • Save your script on your local computer. • Prepare brief printed MS-Word report with problem statement, solution description, working script, and Scratch screen shots. • Upload the script and the report to your group file exchange section on the BlackBoard. • Each team should be able to present (show on the screen) and explain working scripts to the audience in class. • The printed report shall be turned in. Instructor: Dr. Vlasov Lecture is licensed under a Creative Commons Attribution 2.0 License. Slide: 15 EGN-1002 Scratch assignment No. 5 Introduction to Scratch Using Scratch (scratch.mit.edu) design algorithm and script which would perform the following functions: 1. Rotate the vehicle with an arm until it finds (touches) the object 2. “Grab” the object 3. Rotate the vehicle with the object 180 degrees 4. Release the object 5. Move the vehicle off the object Create your own sprite and your own background. • • • • • object vehicle Save your script on your local computer. Prepare brief printed MS-Word report with problem statement, solution description, working script, and Scratch screen shots. Upload the script and the report to your group file exchange section on the BlackBoard. Each team should be able to present (show on the screen) and explain working scripts to the audience in class. The printed report shall be turned in. Instructor: Dr. Vlasov Lecture is licensed under a Creative Commons Attribution 2.0 License. Slide: 16 EGN-1002 Introduction to Scratch Scratch assignment No. 6 Using Scratch (scratch.mit.edu) design an algorithm and a script which would move chosen sprite (a ball) in random direction inside a rectangular box and bouncing off its walls. You may create your own sprites and your own background. • Save your script on your local computer. • Prepare brief printed MS-Word report with problem statement, solution description, working script, and Scratch screen shots. • Upload the script and the report to your group file exchange section on the BlackBoard. • Each team should be able to present (show on the screen) and explain working scripts to the audience in class. • The printed report shall be turned in. Instructor: Dr. Vlasov Lecture is licensed under a Creative Commons Attribution 2.0 License. Slide: 17 EGN-1002 Introduction to Scratch Scratch assignment No. 7 Using Scratch (scratch.mit.edu) design an algorithm and a script which would animate your team name. Maximum length 30 seconds. Your scene needs to have theme music and a stage that reflects your personality, interests, and essence. Include suitable animation for the letters. You may create your own sprites and your own background. • Save your script on your local computer. • Prepare brief printed MS-Word report with problem statement, solution description, working script, and Scratch screen shots. • Upload the script and the report to your group file exchange section on the BlackBoard. • Each team should be able to present (show on the screen) and explain working scripts to the audience in class. • The printed report shall be turned in. Instructor: Dr. Vlasov Lecture is licensed under a Creative Commons Attribution 2.0 License. Slide: 18