Thanks,
I made a file out with all the code I have right now.
The code can be found here :
https://gist.github.com/RoelofWobben/00829deff93e98523f5090383a656582
But still I cannot make it work.
What I did is make a class SantaFloorAct
Op 25-11-2018 om 19:12 schreef dorellang:
What you want to do is:
findBasement: input2
"solution to part1 of this challenge"
input2 withIndexDo: [ :element :index | |action| action:=
SantaFloorAction getActionFor: element. floor := action
calculateNewFloor: floor index: index ].
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: a
What you want to do is:
findBasement: input2
"solution to part1 of this challenge"
input2 withIndexDo: [ :element :index | |action| action:=
SantaFloorAction getActionFor: element. floor := action
calculateNewFloor: floor index: index ].
^ counter
Notice how I added the '