fork(3) download
  1. | tak res |
  2. tak := nil.
  3. tak := [:x :y :z |
  4. x <= y ifTrue: [z] ifFalse: [
  5. tak
  6. value: (tak value: x-1 value: y value: z)
  7. value: (tak value: y-1 value: z value: x)
  8. value: (tak value: z-1 value: x value: y)
  9. ]
  10. ].
  11.  
  12. ((Time millisecondsToRun: [res := tak value: 20 value: 10 value: 0]) -> res) printNl
Success #stdin #stdout 13.19s 7948KB
stdin
Standard input is empty
stdout
13216->1