Hi Roelof,

is not easy to understand the question , without contents.

#calculateNewFloor:index:
- I assume you implemented the method on an action class (SantaAction). 
- In the method I see no usage from argument index 

but to send the method with a index:

aFoor := aAction calculateNewFloor: aFloor index: anIndex.

the method does not return a  floor instance , as you expect in #findBasement:


I hope you can solve you Santa puzzel,
Nic




On 25 Nov 2018, at 17:42, Roelof Wobben <r.wobben@home.nl> wrote:

Hello,

I have made this function :

calculateNewFloor: aFloor index: index
    "comment stating purpose of message"
   |action floor |
   action:= SantaAction getActionFor: aFloor. floor := action doMovementFor: aFloor

now I want to send a message to this function  :

findBasement: input2
    "solution to part1 of this challenge"

     input2 withIndexDo: [ :element :index | |action| action:= SantaFloorAction getActionFor: element. floor := action calculateNewFloor: floor ..  ].
     ^ counter

but how do I get the second argument in this

Roelof