The 2 versions give different results.
Mine:
i =. ".;._1@('x'&,);._2 wd 'clippaste'
+/ (/:~@(1&(*/\.))"1 i) +/ . * 3 2 2
Henry Rich
On 12/2/2015 8:19 PM, 'Pascal Jasmin' via Programming wrote:
was wondering what took 7 lines, but its style
1: with input parsing
+/ +/ (<./, 2&*)"1 */every@:(0 2&{ ; 1 2&{ ; 0 1&{)"1 ". > cutLF 'x ' rplc~
wdclippaste ''
2:
+/ +/@(*/ , +:@(2 {. /:~))("1) ". > cutLF 'x ' rplc~ wdclippaste ''
----- Original Message -----
From: Joe Bogner <[email protected]>
To: [email protected]
Sent: Wednesday, December 2, 2015 7:37 PM
Subject: [Jprogramming] advent of code - day 2
building upon:
http://jsoftware.com/pipermail/programming/2015-December/043407.html,
but starting a new thread since the other one started to go in a
different direction.
http://adventofcode.com/day/2
Here's my solution:
https://github.com/joebo/lang-lab/blob/master/j/advent2015/day2.ijs
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm