[Jprogramming] 1D Rubik's Cube

Raul Miller rauldmiller at gmail.com
Thu Oct 20 22:47:56 HKT 2011


On Thu, Oct 20, 2011 at 10:36 AM, David Vaughan
<purpleblues13 at googlemail.com> wrote:
> It would seem that in the case statements, whenever anything is assigned, it is also displayed - can this be avoided? Also I would appreciate it if anyone could clarify how the $: works here (I copied the idea from a verb somewhere in the wiki).

The last value that was generated outside of a test clause is the
result of the verb.

But it's not being displayed in the verb -- it's being generated as a
result.  The display happens later.

In other words:

shuffle=: 3 :'cube [] move"0 ] 3|?~y'

The [] pair will delay resolution of the value of cube until after the
results from executing move have been completed.

FYI,

-- 
Raul


More information about the Programming mailing list