Alice Community  

Go Back   Alice Community > General Discussion > The Lounge

Reply
 
Thread Tools Display Modes
Assign4-My Kryptonite
Old
puppupcake
Junior Member
 
Status: Offline
Posts: 10
Join Date: Jan 2013
Default Assign4-My Kryptonite - 02-20-2013, 04:01 AM

Okay, so my assignment was late. Assignment 4 was fun, laborious, and confusing all at the same time. I actually ended up doing two assignment as I couldn't get my fish to behave at the end of my assignment. I am having a very difficult time understanding functions. Should I be adding, subtracting, multiplying, or dividing? Is there a formula for what you want to do?

My first Assignment (the one I really wanted to turn in) had all kinds of issues. After creating a lot of methods for my three characters I couldn't bring all the pieces together cohesively. So I put that one to the side and worked all day yesterday and this morning on the one that I just submitted.

Here's what I learned:

1. Using the While statement has a science behind it. I was able to sucessfully capsize my sailboat a countless amount of times.

2. Using the While statement worked brilliantly for my fish but after performing their back flips they didn't want to resurface. I know there is a variable and function for this but where do I even start.

3. I was able to successfully create a method to make my horse walk, my fish swim in a close to realistic fashion, and make my horse sing.

4. I have gotten a lot better with the orientation of objects in my world. I am able to quickly determine which statements to call for turn and roll. etc.

5. Oh yes, I am still in dark about functions and am seriously confused. I will be going in for a one-on-one session.

6. I was dreaming about Alice programming while asleep last night. LOL!!


All in all, this was a brilliant experience for me. I would still like to see my first assignment completed. Even though I had to come up with a totally different storyboard. I have learned soooooooo much from my mistakes and can only hope that I will improve over time.
   
Reply With Quote
Old
chickentree
Super Moderator
 
Status: Offline
Posts: 250
Join Date: Dec 2012
Location: Frosno, Ca
Default 02-20-2013, 07:11 PM

Functions answer questions.
This leads to two points.
  1. Functions return values. The value that is returned depends on the function. Something like "isAbove" will return a Boolean, one object is either above the other or its not. A "distance to" function will return a number. In both cases the function is answering a question. What a function should NEVER do is change the world. If you have a function which asks if the spider robot's head is red, it should return True or False, but the function should not changes the robots head color, just report on its value.
  2. To use a function in Alice, the place where the function is dropped must be looking for an answer of the type the function provides. For instance the if part of an "if/else" statement is looking for a Boolean value. That means we either need to supply a function that returns a Boolean value or we need to use something like a comparison operator. These operators take two numbers and return a Boolean. Another example would be the move instruction, which will take any function that provides a number.

Mark
Never use absolutes, they are always inappropriate, there is never a case that does not have an exception, never use absolutes.

(From an English Professor I took a class with)
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.