View Single Post
Bad problem
Super Moderator
Status: Offline
Posts: 250
Join Date: Dec 2012
Location: Frosno, Ca
Default Bad problem - 12-15-2014, 08:04 PM

IMHO this is a terrible problem. What it says and implies by the picture is that these objects can all be programmed in a list to do the wave. The problem is, as you pointed out, that if you try and use the characters shown, it will never work.
The reason it does not work is that the objects are not all built the same so that the steps in getting one object to wave is not the same as getting another one to wave. This is not to say that all the characters have to be the same type of object, just that they need to be structured the same. If you look at the coach, he has a his arms attached to his upper body and each arm has a hand sub-object. The Random Girl 1, by contrast, has shoulder sub-objects directly beneath the main object. In addition, the sub-objects are arm->forearm->hand. And the Random Guy 1 is different than either of the objects above
he has arms coming off his upper body (like the coach) but the arms consist of arm->elbow->forearm->hand.

In short there is no sane way to program Alice using lists because the sequence of sub-objects from the main character to its hand are different. While you could write a method that test for the type of object and executes different instructions for each type, that kind of defeats the purpose of the exercise.


Mark Henwood
Reply With Quote