Alice Community  

Go Back   Alice Community > General Discussion > Questions and Comments

Reply
 
Thread Tools Display Modes
Having a hard time "reading" Alice code.
Old
ringoffluff
Junior Member
 
Status: Offline
Posts: 3
Join Date: Oct 2014
Location: Maryland
Question Having a hard time "reading" Alice code. - 10-07-2014, 09:52 AM

Hello! I'm a computer science student with previous experience working in IT doing basic programming. I'm taking a prerequisite class that utilizes Alice, and so far I've had perfect grades on all my projects, quizzes, etc. Overall I'm enjoying the program and like the very visual learning style. I have a pretty good grasp of what I'm doing - when I'm the one writing the code.

My problem is that now in my quizzes (and upcoming midterm!), we're being asked questions based on blocks of code. For example, we'll be given a screen cap of code and asked the result of running it when certain conditions are applicable. I am having an awful time answering these questions, and I'm really not sure why. It doesn't make sense that I can put together the projects when asked, but I can't read them back when someone else has made them.

Is there a particular way I should be "reading" these? Are there links anywhere to tutorials or something where someone breaks down how they read through Alice code? I've done quite a bit of searching on my own and haven't come up with anything. My class is online, and unfortunately the tutoring sessions are during my work hours and I'm trying hard to avoid having to take time off of work to go to the tutoring session.

I've attached two screen caps from a previous quiz. The possible answers for it are 3, 4, 6, or 10 meters.

Thanks in advance.
Attached Images
File Type: jpg cap1.JPG (75.4 KB, 16 views)
File Type: jpg cap2.JPG (63.6 KB, 17 views)
   
Reply With Quote
Get some note paper.
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default Get some note paper. - 10-07-2014, 03:21 PM

The easiest way to solve a logic problem in programming is to build a list of the things that must be done to get the answer, and then build a flowchart to solve.
In this case, since the character isn't behind the Frisbee, he has to get to the appropriate starting point by moving an appropriate distance (Note: The problem doesn't appear to take that into account), turning to face the chair(Also not mentioned in code), and loop (Distance to Ball) times moving forward until the Frisbee gets to the chair.

Bottom Line: The code will move the Frisbee, but the Guy won't even be close it, so don't worry about those distractions.

Can you then use the remaining distances to form a solution? Try writing the modified values on a piece of paper to see the interaction.

One of the most exciting challenges in programming is to solve a problem for client. :-)

Last edited by MrMoke; 10-08-2014 at 09:47 AM.
   
Reply With Quote
Old
ringoffluff
Junior Member
 
Status: Offline
Posts: 3
Join Date: Oct 2014
Location: Maryland
Default 10-08-2014, 10:15 AM

Thanks! It is definitely helping me to rewrite the problem on another sheet of paper and figure it out from there. I still feel like I'm missing something, so my instructor is giving me a call this evening to go over it some more. I'll post if I make any good progress, in case anyone else is struggling.
   
Reply With Quote
Ok
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Wink Ok - 10-08-2014, 02:12 PM

He will probably ask you something like:

How many times is the If() statement executed?
   
Reply With Quote
Old
ringoffluff
Junior Member
 
Status: Offline
Posts: 3
Join Date: Oct 2014
Location: Maryland
Default 10-15-2014, 10:42 AM

Just wanted to update -- I have a much better understanding and what helped me was looking at the chunk of code in question as a word problem. That's it. Just made a math problem out of what I was reading, and it helped me organize the information MUCH better.

I took my current chapter's practice quiz yesterday and did very well, so I'm really pleased and feel a lot more confident. Maybe that can help someone else who is just starting out and getting stuck.
   
Reply With Quote
Old
hmerrillb
Junior Member
 
Status: Offline
Posts: 10
Join Date: Nov 2014
Location: usa
Default 11-23-2014, 09:15 AM

looking forward for this topic..


"I would prefer to have no money but to have a nice family and good friends around"
  Send a message via Yahoo to hmerrillb Send a message via MSN to hmerrillb  
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.