Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Thread Tools Display Modes
Exam Question Is A Riddle
Posts: n/a
Unhappy Exam Question Is A Riddle - 06-08-2008, 09:35 PM

Please help me and my mates find out why the answer (the diagram) applies to the given Alice-code.

We can't make heads or tails out of it, suspecting it might have something to with "index1 == 0".

Attached Images
File Type: jpg prob.jpg (92.9 KB, 83 views)
Reply With Quote
Posts: n/a
Default 06-10-2008, 05:02 PM

Had hoped someone who was a teacher would answer this - probably would give a better answer. But, since no one did - here's a quick try.

The diagram is a rough sketch of the path the object will follow when the code is run and the point of the triangle indicates the direction the object will be facing when it starts and ends.

As far as the "==" goes, this is just the "is equal to" Boolean operator - something that should have been covered in your class. It is different from the assignment operator "=" which does the more conventional mathmatical function - a key point, but one well beyond the scope of this posting. I suggest you consult Dick Baldwin's tutorials or your text for that.
Reply With Quote

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 ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.