Alice Community  

Go Back   Alice Community > General Discussion > The Lounge

Reply
 
Thread Tools Display Modes
ITSE1429 Lab2-RE
Old
relliott44444
Junior Member
 
Status: Offline
Posts: 11
Join Date: Sep 2014
Default ITSE1429 Lab2-RE - 10-18-2014, 10:26 AM

All,

The Lab2 is a great learning exercise.

It was not too hard to develop methods to work ok as non-loop. I used a my first method, getlloop, jump and continue methods. Having loop logic took most of the effort.

Next, the development with functioning loop control & passing data needed thorough understanding of textbook chapter readings. In my first method I defined a number variable and an If/Else to control decision for getlloop, jump & continue methods. I set this number variable value in my continue loop based on string input. More below.

The getlloop method obtains the count for actual twirls and provides this value into a variable defined by jump method.

I was greatly aided by use of watch this variable and watch this parameter Alice features for testing.

Coding technique: First define a variable (a dummy I guess) in a method from which you want to pass a value to another method (e.g. I want the continue method to pass information to my first method), then I am able to refer to it in set value. In the set value statement I must then substitute this local variable name with name of variable defined in my first method (this target choice shows up in the dropdown list). Continuing this example, my first method has the variable definition. In final form, the set value statement in continue method now points to it. Once this logic is setup, I may delete the local dummy variable. Then play world and verify with watch this, as noted.

My getloop logic was developed similarly: I want getloop to inform the jump method. The jump method had the definition for number of twirls variable. In getloop method I first used a dummy variable, then set value, and from the dropdown pointed to the jump method variable.

P.S. Loops and events can seem similar but from textbook we know they are different. This Lab2 requires the use of a loops 1) to spin, and 2) to continue.

Richard
   
Reply With Quote
Assign6
Old
chriskcox
Junior Member
 
Status: Offline
Posts: 4
Join Date: Sep 2014
Default Assign6 - 11-05-2014, 07:13 PM

Great job Richard. I wish it came as easy for me. Really struggling.
   
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 ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.