Skip to content

Puzzle Corner: Chess Board Pattern

Vector 7:2, page 19

competitions and puzzles education

Transcribed from the printed issue; not yet reviewed. Read it in the PDF of the issue, page 19

Chess Board Pattern

On the basis that APL can be (and usually is) fun, previous Education Vectors have included a puzzle or challenge section. Although I don’t get inundated with responses, a significant number of readers do send in their thoughts. Indeed, I am still receiving solutions to the original puzzle I included (converting marks into grades).

In this edition I decided to continue the theme of strings and look at the sort of patterns that can be created from a simple vector of two characters, say ⎕ and ∘. The following 9 by 9 squares can be generated easily by APL expressions which end with the string '⎕∘'.

⎕⎕⎕∘∘∘⎕⎕⎕  ⎕⎕⎕∘∘∘⎕⎕⎕  ⎕⎕⎕∘∘∘⎕⎕⎕
∘∘∘⎕⎕⎕∘∘∘  ∘∘∘⎕⎕⎕∘∘∘  ∘∘∘⎕⎕⎕⎕⎕⎕
⎕⎕⎕∘∘∘⎕⎕⎕  ⎕⎕⎕⎕⎕⎕∘∘∘  ∘∘∘⎕⎕⎕∘∘∘
∘∘∘⎕⎕⎕∘∘∘  ⎕⎕⎕∘∘∘⎕⎕⎕  ⎕⎕⎕⎕⎕⎕∘∘∘
⎕⎕⎕∘∘∘⎕⎕⎕  ∘∘∘⎕⎕⎕⎕⎕⎕  ⎕⎕⎕∘∘∘⎕⎕⎕
∘∘∘⎕⎕⎕∘∘∘  ∘∘∘⎕⎕⎕∘∘∘  ⎕⎕⎕∘∘∘⎕⎕⎕
⎕⎕⎕∘∘∘⎕⎕⎕  ⎕⎕⎕∘∘∘⎕⎕⎕  ∘∘∘⎕⎕⎕⎕⎕⎕
∘∘∘⎕⎕⎕∘∘∘  ⎕⎕⎕∘∘∘⎕⎕⎕  ∘∘∘⎕⎕⎕∘∘∘
⎕⎕⎕∘∘∘⎕⎕⎕  ∘∘∘⎕⎕⎕∘∘∘  ⎕⎕⎕⎕⎕⎕∘∘∘


⎕⎕⎕∘∘∘⎕⎕⎕  ⎕⎕⎕∘∘∘⎕⎕⎕
∘∘∘⎕⎕⎕⎕⎕∘  ⎕⎕⎕∘∘∘⎕⎕⎕
∘∘⎕⎕⎕∘∘∘⎕  ⎕⎕⎕∘∘∘⎕⎕⎕
⎕⎕⎕⎕∘∘∘⎕⎕  ∘∘∘⎕⎕⎕∘∘∘
⎕∘∘∘⎕⎕⎕⎕⎕  ∘∘∘⎕⎕⎕∘∘∘
∘∘∘⎕⎕⎕∘∘∘  ∘∘∘⎕⎕⎕∘∘∘
⎕⎕⎕⎕⎕∘∘∘⎕  ⎕⎕⎕∘∘∘⎕⎕⎕
⎕⎕∘∘∘⎕⎕⎕⎕  ⎕⎕⎕∘∘∘⎕⎕⎕
⎕∘∘∘⎕⎕⎕∘∘  ⎕⎕⎕∘∘∘⎕⎕⎕

This edition’s puzzle corner is to identify simple APL expressions that will produce some of these patterns; in particular the last pattern which is basically a chess-board. Having produced this, then production of a full size chess board should be easy. Please send your solution(s) or patterns to the editorial address.