Skip to main content
i' -> i':
Source Link
ngn
  • 15.7k
  • 2
  • 47
  • 92

K (ngn/k)K (ngn/k), 2324 bytes

{x+x&2{++/'3'0'3':0,x,0}/~x}

Try it online!Try it online!

uses 0 1 2 for "AB+"

{ } function with argument x

~ logical not

2{ }/ twice do

  • 0,x,0 surround with 0-s (top and bottom of the matrix)

  • 3': triples of consecutive rows

  • +/' sum each

  • + transpose

x& logical and of x with

x+ add x to

K (ngn/k), 23 bytes

{x+x&2{++/'3'0,x,0}/~x}

Try it online!

uses 0 1 2 for "AB+"

{ } function with argument x

~ logical not

2{ }/ twice do

  • 0,x,0 surround with 0-s (top and bottom of the matrix)

  • 3' triples of consecutive rows

  • +/' sum each

  • + transpose

x& logical and of x with

x+ add x to

K (ngn/k), 24 bytes

{x+x&2{++/'3':0,x,0}/~x}

Try it online!

uses 0 1 2 for "AB+"

{ } function with argument x

~ logical not

2{ }/ twice do

  • 0,x,0 surround with 0-s (top and bottom of the matrix)

  • 3': triples of consecutive rows

  • +/' sum each

  • + transpose

x& logical and of x with

x+ add x to

forwards compatibility
Source Link
ngn
  • 15.7k
  • 2
  • 47
  • 92

K (ngn/k)K (ngn/k), 23 bytes

{x+x&2{++/'3'0,x,0}/~x}

Try it online!Try it online!

uses 0 1 2 for "AB+"

{ } function with argument x

~ logical not

2{ }/ twice do

  • 0,x,0 surround with 0-s (top and bottom of the matrix)

  • 3' triples of consecutive rows

  • +/' sum each

  • + transpose

x& logical and of x with

x+ add x to

K (ngn/k), 23 bytes

{x+x&2{++/'3'0,x,0}/~x}

Try it online!

uses 0 1 2 for "AB+"

{ } function with argument x

~ logical not

2{ }/ twice do

  • 0,x,0 surround with 0-s (top and bottom of the matrix)

  • 3' triples of consecutive rows

  • +/' sum each

  • + transpose

x& logical and of x with

x+ add x to

K (ngn/k), 23 bytes

{x+x&2{++/'3'0,x,0}/~x}

Try it online!

uses 0 1 2 for "AB+"

{ } function with argument x

~ logical not

2{ }/ twice do

  • 0,x,0 surround with 0-s (top and bottom of the matrix)

  • 3' triples of consecutive rows

  • +/' sum each

  • + transpose

x& logical and of x with

x+ add x to

added 12 characters in body
Source Link
ngn
  • 15.7k
  • 2
  • 47
  • 92

K (ngn/k), 23 bytes

{x+x&2{++/'3'0,x,0}/~x}

Try it online!

uses 0 1 2 for A, B, and +"AB+"

{ } function with argument x

~x~ logical not

2{ }/ twice do

0,x,0 surround with 0-s (top and bottom)

3' triples of consecutive rows

+/' sum each

+ transpose

  • 0,x,0 surround with 0-s (top and bottom of the matrix)

  • 3' triples of consecutive rows

  • +/' sum each

  • + transpose

x& minima betweenlogical and of x andwith

x+ add x to

K (ngn/k), 23 bytes

{x+x&2{++/'3'0,x,0}/~x}

Try it online!

uses 0 1 2 for A, B, and +

{ } function with argument x

~x logical not

2{ }/ twice do

0,x,0 surround with 0-s (top and bottom)

3' triples of consecutive rows

+/' sum each

+ transpose

x& minima between x and

x+ add x to

K (ngn/k), 23 bytes

{x+x&2{++/'3'0,x,0}/~x}

Try it online!

uses 0 1 2 for "AB+"

{ } function with argument x

~ logical not

2{ }/ twice do

  • 0,x,0 surround with 0-s (top and bottom of the matrix)

  • 3' triples of consecutive rows

  • +/' sum each

  • + transpose

x& logical and of x with

x+ add x to

Source Link
ngn
  • 15.7k
  • 2
  • 47
  • 92
Loading