Demo entry 4452656

Smalltalk if Statement

   

Submitted by anonymous on Apr 13, 2016 at 04:17
Language: Smalltalk. Code size: 113 Bytes.

[ :x |  
	x = 1 ifTrue: [^'One'].
	x = 2 ifTrue:[^'Two'].
	x = 3 ifTrue:[^'Three'].
	^'Unknown'.
] value: 0.

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).