I am finding a "length error" in the `kmoves` monad at the following link.

https://code.jsoftware.com/wiki/Essays/Knight%27s_Tour

Below is an excerpt of my jconsole session. The error is NOT created if I
split the failing code expression up as you can see at the very bottom.

   kmoves=: 3 : 0
 t=. (>,{;~i.y) +"1/ _2]\2 1 2 _1 1 2 1 _2 _1 2 _1 _2 _2 1 _2 _1
 (*./"1 t e. i.y) <@#"1 y#.t
)
   kmoves 8
|length error: kmoves
|   (*./"1 t e.i.y)    <@#"1 y#.t
   load'debug'
   dbss'kmoves 1'
   dbr 1
   kmoves 8
|stop: kmoves
|   (*./"1 t e.i.y)<@#"1 y#.t
|kmoves[1]
      (*./"1 t e.i.y);&$ y#.t
┌────┬────┐
│64 8│64 8│
└────┴────┘
      datatype (*./"1 t e.i.y)
boolean
      datatype y#.t
integer

      l=.(*./"1 t e.i.y)[r=. y#.t

      $l <@#"1 r      NB. no error here, though

64
      JVERSION
Engine: j903/j64/darwin
Release-b: commercial/2022-01-28T04:11:24
Library: 9.03.08
Platform: Darwin 64
Installer: J903 install
InstallPath: /users/brian/j903
Contact: www.jsoftware.com

-- 
(B=) <-----my sig
Brian Schott
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to