DEV Community

loading...

Discussion on: FizzBuzz challenge in as many languages as possible

Collapse
mattonem profile image
maxmattone

Language: Smalltalk
Code:

1 to: 100 do: [ :i | 
    Transcript
        show:
            ((i isDivisibleBy: 15)
                ifTrue: [ 'FizzBuzz' ]
                ifFalse: [ (i isDivisibleBy: 3)
                        ifTrue: [ 'Fizz' ]
                        ifFalse: [ (i isDivisibleBy: 5)
                                ifTrue: [ 'Buzz' ]
                                ifFalse: [ i ] ] ]);
        cr ]
Collapse
teotcd profile image
JedDevs Author

👏👏👏, never used that language.