Alice Community  

Go Back   Alice Community > General Discussion > The Lounge

Reply
 
Thread Tools Display Modes
ITSE-1429_RLForms5
Old
WindowsManic
Member
 
Status: Offline
Posts: 20
Join Date: Jan 2015
Default ITSE-1429_RLForms5 - 02-21-2015, 01:48 PM

This time around I made my own customized bouncer from Alice built from the character builder. The bouncer had some pretty cool features. For example, he had built in methods for being angry, happy, and idle. It was very useful because I did not have to manipulate his arms and legs for things like I had to do is assignment 4 and 3. To complete this Assignment, I made two variables. One named input and the other age. Age was a constant 21 and input is anything the user decided to input,by default I made the input equal zero. To use the variables in the program, I dragged input variable to the main method and found the ask for number function in the world function. I created three if statements with three conditions.If the user typed twenty-one, the bouncer would be happy and welcome the user in the club;however, if the user picked any age below twenty-one, the bounce will get angry and say you are too young or you are too old if the age is above twenty-one.

This lesson was simple for me only because of my previous experience with if statements in other languages like C++,C,Qbasic, Justbasic and ChipmunkBasic. The only thing I need to learn is how to make manipulate files in programming and study pointers a little bit more. I enjoyed this assignment more then our lab assignments, only because making a Character solve E= mc2 Numbers comes out as 1.35464564556E10, By doing further reading, I found it that its trying to convert my numbers to a string. I hope I wont have to redo my lab assignment because of these weird results. Anyways I wish good luck to all the other students out their, This assignment is pretty straight forward and should be much easier then making an Animal Jump across the screen in a realistic manner.
   
Reply With Quote
Itse 1429
Old
logicanddesign
Junior Member
 
Status: Offline
Posts: 4
Join Date: Jan 2015
Default Itse 1429 - 02-23-2015, 03:47 PM

I used only one variable.

Will that give me less control in the code? and also I created only one variable.

I am getting worried, may be I will revisit the assignment

The emotions part is really impressive.
   
Reply With Quote
ITSE-1429_RL_response
Old
WindowsManic
Member
 
Status: Offline
Posts: 20
Join Date: Jan 2015
Default ITSE-1429_RL_response - 02-23-2015, 04:55 PM

I am impressed if you managed to do it with one variable. How does your program work? The Character builder can be found in people objects. Instead of picking Alice pre-created people, I found a He,Shebuilder which comes with emotion methods after you customize you person. I don't think having more then one variable gives me more control over my code. If you can do it with one variable, then you are doing something right. Your code will take up less memory and will probably be more efficient then mine in the long run. The only reason I used two variables is because based on my previous programming experiences, I am accustomed to think that I may need to modify this my code one day. Maybe you made your program work like this.

pseudo code
Int user_input;
if(user_input >21){
to old
if(user_input<21){
to young
{
else
user_input = 21
print welcome to our club"!
}
}
}

Their is nothing wrong with having one variable if it get the job done. The only advantage I can see to my code is that I can modify the age = 21 if we wanted to modify the program later. Let say you had to write a program like this that is 1000 lines of code. If later somebody told you, The club now accepts people that are 25 to 30, It is easier to modify the one variable , then to find all the places that you put the number 21 in the program. That is the only reason why I used two variables instead of one. For an assignment like this however, It works just fine.
   
Reply With Quote
Reply


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.