100 likes | 114 Views
Alice. An introduction to programming Created by Dr. Randy Pausch. Alice Programming Language. Created by Dr. Randy Pausch (known for “The Last Lecture) Carnegie Mellon University, Pittsburgh Free for downloading from www.alice.org
E N D
Alice An introduction to programming Created by Dr. Randy Pausch
Alice Programming Language • Created by Dr. Randy Pausch (known for “The Last Lecture) • Carnegie Mellon University, Pittsburgh • Free for downloading from www.alice.org • Installed on most lab machines around campus – Instructional Software / Alice
IDE • Interactive (or integrated) development environment • Object tree • Editor • Event window • Window of the world • Details about the current object
Process for starting a world • Click green button – “Add Objects” • Choose some objects to add to world • Can have more than one instance of a class (an object), they will be numbered fish1, fish2, fish3… • Don’t spend ALL your time doing this! • Click DONE when finished adding • You can come back later and add more
To ‘write’ a program • Click on an object, either in object tree or in picture of world • Choose a method from the list available and drag to the editor window – it will turn green when you can drop it • Put it in the sequence you want executed • Answer questions about arguments for the method, if any • Alice makes it hard to make a syntax error!
To translate and execute a program • Click the Play button in the upper left hand corner of the IDE • Remember to close the play window or click the stop button before going back to the editor window
Control Structures • Look just below the Editor window – there is a bar there • You can drag those things into your program also • Loop and While are “repetition” structures • If/Else is the “selection” structure • “Sequence” is shown by the order the methods are used in the Editor window
Functions vs Methods • This is the terminology used by Alice • Not quite same as OOP • Functions ask questions and give back answers “how far?” “how big?” “is near?” “is not near?” • Methods are actions “move” “turn” “talk”
Saving Alice worlds • File menu “Save World” option • You can browse to where you want the world saved • Extension will be “a2w” “Alice version 2 world” • Automatically makes a folder called “backups of “worldname • The more objects the bigger the world!
Loading in a world you made • You CANNOT double-click on the file where the world is to run it • You must run Alice.exe first • Then from the File menu, use “Open World”