Alice Community

Alice Community (
-   The Lounge (
-   -   ITSE1429 Lab4-RE (

relliott44444 11-24-2014 01:43 AM

ITSE1429 Lab4-RE
re: ITSE1429 Lab4-RE

LAB 4 Observations

My Lab4 solution was heavily dependent on design decisions of Lab 3 with the addition of logic supporting arrays for the objects. I also used the setting of torus' visibility property and speed values.

It is key to use arrays for torus, home, and ground objects. An array also holds speed values. Like Lab3, my main loop depends on the catch counter. The need to vary the torus display necessitated use of a separate 'iteration' counter. Also, the arrays use a separate index.

Some major logic additions were necessary. Within the main loop I use a large if/else, and based on iteration value, it controls how many torus are 'un-cloaked' and in play. Within this are nested sub-loops utilizing an index for array 'nth' items.

The code is actually more straight-forward than done for Lab3.

A journey begins by making torus(s) visible, setting speed(s), and proceeding to move the item(s) down to ground(s). For example 'move torus(1) to ground(1), duration speed(1). Next is 'catch' determination. Importantly, functions do the cone distance checking, one for each torus. They are boolean and when evaluating true, a 'catch' is registered. The block within the if/else concludes by sending back the torus(s) to the home array item(s).

The if/else is critical. In the first block (early iteration values), there is one torus in play, going to one ground, with one speed value, one function call, and one return home.

In the middle block of the if/else (mid-range iterations), two torus' are included but the preceeding construct is the same.

Eventually the last block of the if/else brings in all torus' and related objects at once.

Similar to Lab3, cone operation is independent of the torus'.
I found it best to use functions to check cone distance. As mentioned, I invoke one, some or all of them after torus(s) arrival on ground, (before returning them home).

The play seems satisfactory. When the cone is correctly in position, it does result in a catch but there is also no gain from arriving too late. The cone can be stationary and if parked in the right position, catches can be racked up.


dukonye 12-09-2014 02:40 AM

lab 3
hello richard, how are you? please i need help on how to do lab 3 to 4, i am done with everything just stock with this two labs , please can you help me?

All times are GMT -5. The time now is 08:56 AM.

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