Skip to main content
deleted 1 characters in body
Source Link
Martin Ender
  • 197.2k
  • 67
  • 447
  • 975

Mathematica, 4544 characters

Outer[List,d=Range[3]d=Range@3-2,d]~Flatten~1~Drop~{5}

Well. Generates all 9 coordinates, flattens the list and drops the centre.

Mathematica, 45 characters

Outer[List,d=Range[3]-2,d]~Flatten~1~Drop~{5}

Well. Generates all 9 coordinates, flattens the list and drops the centre.

Mathematica, 44 characters

Outer[List,d=Range@3-2,d]~Flatten~1~Drop~{5}

Well. Generates all 9 coordinates, flattens the list and drops the centre.

deleted 1 characters in body
Source Link
Martin Ender
  • 197.2k
  • 67
  • 447
  • 975

Mathematica, 4645 characters

Outer[List,d=Range[d=Range[3]-1,1]2,d]~Flatten~1~Drop~{5}

Well. Generates all 9 coordinates, flattens the list and drops the centre.

Mathematica, 46 characters

Outer[List,d=Range[-1,1],d]~Flatten~1~Drop~{5}

Well. Generates all 9 coordinates, flattens the list and drops the centre.

Mathematica, 45 characters

Outer[List,d=Range[3]-2,d]~Flatten~1~Drop~{5}

Well. Generates all 9 coordinates, flattens the list and drops the centre.

deleted 225 characters in body
Source Link
Martin Ender
  • 197.2k
  • 67
  • 447
  • 975

Mathematica, 2746 characters

Outer[List,d=Range[-1,1],d]

Here is a different (straight-forward) approach using 30 characters:

Range[{i,j},{i,-1,1},d]~Flatten~1~Drop~{j,-1,15}]

Note that these produce nested lists (basically a matrix where each element is equal to its coordinates)Well. If you don't want that you need to surround each answer in Flatten[...,1] for another 11 charactersGenerates all 9 coordinates, flattens the list and drops the centre.

Mathematica, 27 characters

Outer[List,d=Range[-1,1],d]

Here is a different (straight-forward) approach using 30 characters:

Range[{i,j},{i,-1,1},{j,-1,1}]

Note that these produce nested lists (basically a matrix where each element is equal to its coordinates). If you don't want that you need to surround each answer in Flatten[...,1] for another 11 characters.

Mathematica, 46 characters

Outer[List,d=Range[-1,1],d]~Flatten~1~Drop~{5}

Well. Generates all 9 coordinates, flattens the list and drops the centre.

Source Link
Martin Ender
  • 197.2k
  • 67
  • 447
  • 975
Loading