Because of this difficulty, I invented a new programming language.
Puzzle solver may be found at
http://forums.devshed.com/programming-languages-139/reversed-972280.html#post2963935
Date: Fri, 11 Dec 2015 02:48:25 -0500
From: David Lambert<b49p23t...@gmail.com>
To: programming<programm...@jsoftware.com>
Subject: [Jprogramming] adventofcode 11
Message-ID:<566a7fc9.9080...@gmail.com>
Content-Type: text/plain; charset=utf-8; format=flowed
In the session below, the final sentence
valid A
runs "forever". Why?
$ ijconsole
JVERSION
Engine: j803/2014-10-19-11:11:11
Library: 8.04.13
Platform: Linux 64
Installer: unknown
InstallPath: /usr/share/j/8.0.4
LC=: 26}.Alpha_j_
a2v=: _8{.LC&i.
NB. these tests apply to numerical vectors.
straight=: 1 e. _1 _1 E. 2 -/\ ]
oil=: 1 e. 14 8 11&e.
pairs=: ((1 < {: - {.)*.(1 < #))@:([: I. 0 = 2 -/\ ])
valid=: straight *. -.@:oil *. pairs
TEST=:>;:'hijklmmn abbceffg abbcegjk abcdefgh abcdffaa ghijklmn
ghjaabcc'
([: valid a2v)"1 TEST NB. passes the small test suite.
0 0 0 0 1 0 1
[A=: a2v'abcdddoz'
0 1 2 3 3 3 14 25
valid A
^Z
[1]+ Stopped ijconsole
$
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm