Guest User

Untitled

a guest
Sep 15th, 2018
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. "first"
  2.  
  3. 1 to: 6 do: [:i |
  4.       1 to: i do: [:j |
  5.             Transcript show: (i odd ifTrue: j ifFalse: i-j+1);
  6.         show: (i=j ifTrue: '' ifFalse: $-)].
  7.       Transcript cr].
  8.  
  9. "and second, in one line"
  10.  
  11. 1 to:6 do:[:i|1 to:i do:[:j|Transcript show:(i odd ifTrue:j ifFalse:i-j+1);show:(i=j ifTrue:''ifFalse:$-)].Transcript cr].
Add Comment
Please, Sign In to add comment