1 / 16

Alice and Algorithms

Alice and Algorithms. Chapter 1 Part 1. Reasons to Program. The joy of programming To create a tool To use your creativity abilities For non programmers Learn a new way to think Drawing course does same thing Helps problem solving skills Finding answer to question

astin
Télécharger la présentation

Alice and Algorithms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Alice and Algorithms Chapter 1 Part 1

  2. Reasons to Program • The joy of programming • To create a tool • To use your creativity abilities • For non programmers • Learn a new way to think • Drawing course does same thing • Helps problem solving skills • Finding answer to question • Determine how to perform a task

  3. Alice • A modern programming tool • 3-D graphics • 3-D models of objects • People, animals, fantasy creatures, vehicles and backgrounds • Animation • Objects can be moved around a 3D virtual world • Similar to a video game or simulation • CD in book has Alice worlds from chapters • Can download Alice 2.4 from the web www.alice.org

  4. Alice Examples Example Alice worlds Promotion video

  5. Origination of Alice • Named in honor of mathematician Charles Lutwige Dodson • Was able to do complex math and logic • Knew he needed to make things for learner • Simple • Fascinating • Pen name was Lewis Carroll who wrote • Alice in Wonderland • Through the Looking Glass

  6. Alice Programming in Alice is like being a movie director, puppeteer, or choreographer in a 3D world You create programs by dragging words and objects to editor with mouse

  7. Kinds of Animations • Two kinds of animations • Movie • Can tell a story • Passively watch animation • Interactive • Active user clicks on mouse or types on keyboard • User actions are called events

  8. Programming Terminology Algorithm – step by step structure to solve a problem Program – implementation of algorithm using a programming language Instruction – an action to be performed Pseudo code – loose set of instructions not tied to any program environment

  9. Computer • A device that follows instructions for manipulating and storing data • Computer program – set of instructions that computer follows to perform a task • Instructions must be carefully written to follow a logical sequence • That is key – you think of logical sequence you want computer to follow • Running or executing program – when computer is performing instructions

  10. Algorithms • Example: Making a cup of instant coffee • Remove lid from coffee jar • Put lid down on counter • Remove 1 tsp of coffee from jar • Place that coffee in a cup • Add 8 oz of boiling water to cup • Use teaspoon to stir water and coffee mixture • Stir 10 revolutions • Remove teaspoon from cup and place on counter Is this adequate? Is it detailed enough? Is anything ambiguous? • Algorithm • Set of well-defined logical steps • Must be performed in order to perform a task

  11. Algorithms Blah Blah Blah 01100010011011000110000101101000001000000110001001101100011000010110100000100000 01100010011011000110000101101000 Algorithms are understandable by humans (natural language) Computers understand machine language not natural language

  12. Programming Languages Starting…010100110111010001100001011100100111010001101001011011100110011100100000 out…011011110111010101110100 With …0111011101101001011101000110100000100000 Alice …0100000101101100011010010110001101100101 • Programming languages are converted to machine language by • Compiler – Instructions converted before executing program • Interpreter – Each instruction is individually converted during execution, Ex: Alice

  13. Programming Languages • Operators • + - * / • Perform arithmetic and other functions on data • Syntax • Set of rules that must be followed • Similar to the set of rules that are followed when people speak a natural language • Program or code • Consists of keywords, operators, punctuation arranged in proper logical sequence • Save, compile, link, executable program is produced

  14. Checkpoint What is a computer? What is an algorithm? What is a program? What language is an algorithm written in? What is the only language computers understand? Why were programming languages invented?

  15. Class Exercise Write an algorithm that explains how to make a Peanut Butter and Jelly sandwich Assume the person does not know anything about how to make sandwiches

  16. Homework Describe the scene of two volleyball players on opposite sides of a volleyball net Write an algorithm to have one player serve the ball to the other Have the other jump up with arms raised to block the ball Have the ball fall to the ground across from the net. Make sure you reset the players to the resting position Reset server at same time as ball moves

More Related