PRB - Basic Programming (Lesson)

Basic Programming

Beginning the Programming Journey

Now we are ready to begin our programming journey. We are going to use a block language and a three dimensional, 3D, programming environment called Alice3. This environment will let us see visually what we are programming as well as let us begin creating programs with many details handled for us. Remember abstraction?

Alice3 is free software from the Carnegie Mellon University. This software will give you a myriad of options for displaying your knowledge to College Board on the AP Exam for this course. The software will be one of several techniques that will allow you to encompass all of the techniques in programming that will be needed on the exam. Download the software following directions from Carnegie Mellon.

Now let's get started learning how to program in Alice.  

Alice Orientation

First watch the video below to get started with the basic how to of Alice. Follow along and do this in your copy of Alice.

Programming Saving Techniques 

Now watch the following video to examine programming save techniques and the biped people setup in Alice. Continue to follow along and build in your Alice program. Stop the video and make sure you understand at various points.

Alice3 Gallery Tour

Take note of some important understandings to code efficiently.

  1. Code small pieces at a time.
  2. Test for correctness of the small piece prior to adding another piece of code to do something new.
  3. Doing too much at one time does not work for great understanding.  
  4. Doing too much at one time leaves the coder open to errors that are difficult to find and debug; yes debug, remember Grace Hopper.

Now, let's take a tour of the Alice3 gallery.

Adding Objects to Scenes in Alice3 

Now we will look at the scene editor in Alice3 - specifically, how to add an object to your scene.  

Prevalent Terms in Object Oriented Programming [OOP]

Below are some vocabulary words that are prevalent in object oriented programming, OOP. Object oriented programming is based around the concept that repeatedly creating the same type code is not efficient or effective when the need is to create and develop new items.

For instance why would we keep describing an object that walks on two legs?  Objects that walk on two legs can have their common descriptions combined in one place. Unique parts of the object can be described separately. For example, a dog barks and a cat meows.   Both however speak, but differently so the speak method of barking would not be at the biped level descriptions, but the dog description.

  1. pivot point - the spot at the bottom of an object  around witch the object will turn.
  2. instantiation - on instance of a particular object, for example, if you had two dogs in a scene, one dog might be called Fido and the other Rover, but both are dogs, so each is an instance of the four-legged class containing dog. Each dog could have different characteristics besides their name. One might be brown and the other might have spots.
  3. orientation - the direction the object is facing is the forward direction.
  4. First Method - where the program must start, also sometimes called the main method, or procedure.
  5. turn - left, right, forward, or backward. The turn only turns the object and changes its forward rotation.
  6. roll - object tips left or right
  7. scene - the background
  8. class - a grouping of objects with like mobility types, i.e., bipeds.
  9. object - one item of a class.

VIDEOS SOURCED FROM ALICE.ORG Links to an external site.  AND USED WITH PERMISSION.