Raul's listing at
http://www.jsoftware.com/pipermail/programming/2017-June/047522.html
works fine for me!

Mike (Day, not Rice!)

On 08/06/2017 15:07, Michael Rice wrote:
    move_table=:
<:(,|."1)(#~0<*/"1)~.,/,/_3&{.\@/:~"1(,|:"2)>|:((;|.)@(1++)+/)\i.5

    flip=: ~: (i.15)&e.

    legal_moves=: [ #~ 6 = 2 #. {

    search=:3 :0
   ((15#1) flip y) search i.0 3
   NB. x: board; y: moves
:
   if. 1=+/x do. y return. end.
   for_move. move_table legal_moves x do.
     r=.(x flip move) search move,y
     if. #r do. r return. end.
   end.
   i.0 3
)


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to