Generate Chess960 starting position: Difference between revisions
Generate Chess960 starting position (view source)
Revision as of 22:48, 18 September 2019
, 4 years ago→{{header|Factor}}: simplify "next" word
m (→{{header|Factor}}: unhyphenate the name of the method used) |
m (→{{header|Factor}}: simplify "next" word) |
||
Line 485:
: empty ( seq -- n ) 32 swap indices random ; ! return a random empty index (i.e. equal to 32) of seq
: next ( seq -- n )
: place ( seq elt n -- seq' ) rot [ set-nth ] keep ; ! set nth member of seq to elt, keeping seq on the stack
|