To add to what Joachim has said, and to help you help yourself, look at what 
methods are implemented in BlockClosure and Boolean and see how things work 
(the code is there for you to understand it quite easily - there is little 
magic going on). You can find all kinds of interesting and helpful things and 
can even implement your own if you ever want to.

Tim

Sent from my iPhone

> On 9 Nov 2018, at 16:02, Joachim Tuchel <jtuc...@objektfabrik.de> wrote:
> 
> So I guess that floor > 0 is your condition, right? In Smalltalk, the idea is 
> that you evaluate the condition and ask the result of it (usually true or 
> false) to do something.
> 
> Right so far? That would mean the receiver of your wanted message is either 
> the result of the evaluation or or a Block which will be evaluated in a 
> construct like ifTrue: or something like whileTrue:
> 
> HTH
> 
> Joachim
> 
> 
> 
>> Am 09.11.2018 um 08:24 schrieb Roelof Wobben <r.wob...@home.nl>:
>> 
>> Hello,
>> 
>> I try to solve a adventofcode challenge where I must find out when santa is 
>> first at the basement. the floor is there -1.
>> So I thought I use a while loop like this :
>> 
>> santaFloorOnBasement
>>    "calculates which step take Santa to the basement"
>>     | index|
>>     index := 1.
>>     ??? when: (floor >=0 ) do:
>>        [ floor := (input at: index = '(' )
>>                ifTrue: [ floor + 1 ]
>>                ifFalse: [ floor - 1 ].
>>         index := index + 1 ].
>> 
>> but I cannot find out what must be instead of the ??
>> 
>> index is the index of the string which has to start with a 1.
>> floor  and input are both instance variables. floor contains the current 
>> floor and input the input of the challenge.
>> 
>> Can someone help me figure this out so the next time I can do this on my own.
>> 
>> Roelof
>> 
>> 
>> 
> 
> 


Reply via email to