# Diagonalized alphabet

# Task

Print the following:

```
ABDFHJLNPRTVXZ
CABDFHJLNPRTVX
ECABDFHJLNPRTV
GECABDFHJLNPRT
IGECABDFHJLNPR
KIGECABDFHJLNP
MKIGECABDFHJLN
OMKIGECABDFHJL
QOMKIGECABDFHJ
SQOMKIGECABDFH
USQOMKIGECABDF
WUSQOMKIGECABD
YWUSQOMKIGECAB
```

and nothing else. You may return a multiline string or an array representing the box.

You may have trailing whitespace in your output if it is a multiline string.

This is code-golf. Shortest answer in bytes bins.

BQN, 18 bytesSBCS ``` 'A'- …

5d ago

Canvas, 17 11 bytes Ｚ２ｎ⤢Ｊ …

6d ago

[APL (Dyalog Unicode)], 31 byt …

4d ago

## 3 answers

#
BQN, 18 bytes^{SBCS}

```
'A'-¬⊸⌊2×13-˜⌜○↕14
```

This solution computes a table of `c-r`

, where `r`

is the row number and `c`

is the column number, so that the first row is `0 1 2…`

and the first column is `0 ¯1 ¯2…`

. After this it maps non-positive numbers `0 ¯1 ¯2…`

to `A C E…`

, and positive ones `1 2…`

to `B D…`

, using the arithmetic expanded below. BQN's extension of boolean negation `¬`

to mean one minus the argument is helpful here.

```
'A'-¬⊸⌊2×13-˜⌜○↕14
13 14 # Numbers
○↕ # Range of each
-˜⌜ # Subtract-from table 0 ¯1 ¯2 / 1 2
2× # Times two 0 ¯2 ¯4 / 2 4
¬⊸ # 1 minus, then… 1 3 5 / ¯1 ¯3
⌊ # Minimum with original 0 ¯2 ¯4 / ¯1 ¯3
'A'- # Subtract from 'A' A C E / B D
```

#### 0 comments

#
Canvas, ~~17~~ 11 bytes

```
Ｚ２ｎ⤢Ｊ｛×７«ｍＴ
```

```
Z The alphabet
2n split into pairs: ["AB","CD","EF",…]
⤢ transposed: ["ACEGI…","BDFHJ…"]
J remove and push the first item: ["BDFHJ…"], "ACEGI…"
{ for each character of "ACEGI…"
× prepend horizontally: "ABDFHJ…" → "CABDFHJ…" → …
7«m cut off everything after 14 chars
T print that, leaving the item on the stack for the next iteration
```

#### 0 comments

# APL (Dyalog Unicode), 31 bytes

```
⎕←↑(14↑(2⌷x),⍨⌽)¨,\1⌷x←⍉13 2⍴⎕A
```

Lot worse than the BQN answer.

```
⎕←↑(14↑(2⌷x),⍨⌽)¨,\1⌷x←⍉13 2⍴⎕A
⎕A ⍝ String of uppercase letters
13 2⍴ ⍝ Turn that into a matrix where the
⍝ first column is ACE... and the second is BDF...
⍉ ⍝ Turn those columns into rows
x← ⍝ Assign to x
1⌷ ⍝ Get the first row ('ACE...')
,/ ⍝ Prefixes of that
¨ ⍝ Map each prefix:
⌽ ⍝ Reverse it
,⍨ ⍝ And prepend it to
(2⌷x) ⍝ The second row of x ('BDF...')
14↑ ⍝ Keep the first 14 letters
↑ ⍝ Make it a matrix
⎕← ⍝ Print it (not totally necessary)
```

# APL (Dyalog Unicode), 33 bytes

```
⎕←↑(⌽⍳13)(14↑↓)¨⊂↑,⍨∘⌽⍨/↓⍉13 2⍴⎕A
```

Requires zero-indexing.

## 0 comments