Conway의 포인트 게임!

Sep 25 2020

평화로운 휴식, John Horton Conway

있다 톤 거기 생명 통역의 다른 게임의은! 톤 !

현재 통역사를 구하는 것은 12 가지 유형과 몇 번의 클릭만으로 가능합니다.

그러나 잠깐, 통역사에서 일반적인 것을 눈치 챘습니까? 모든 인터프리터는 그래픽입니다 . 즉, 이미지 만 있고 ASCII 텍스트는 없습니다!

문제

재미있는 사실 : 이 질문을 작성하는 동안 제가 가장 좋아하는 실용적인 프로그래밍 언어로 2DF 인터프리터 를 만드는 중이었습니다 . 2DF에는 메모리 필드에 Game of Life의 단계를 수행하는 명령이 있습니다. 내 코드에서 해당 명령을 구현해야했습니다. 나는 아직 그것을하지 않았기 때문에이 질문은 기술적으로 도전 이라기보다는 실제 질문이다.

나는이 몇 가지 포인트 또는 좌표 목록 A의 직교 비행기를 . 각 포인트에는 X 및 Y 값이 있습니다. 이것은 당신의 입력입니다! 입력은 어쨌든 형식화 할 수 있습니다 (모든 형식의 형식을 사용할 수 있으므로 답변에 형식을 지정하십시오).

입력 형식 예 :

[[0, 0], [1, 0], [2, 0], [2, 1], [1, 2]]

이것은 글라이더 (해커 로고) 의 기간을 나타냅니다 . 격자에 점을 그리면 다음과 유사한 모양이 표시됩니다.

출력을 위해 원하는 것은 동일한 목록이지만 수정되었습니다! 다음은 수정 단계입니다.

  • 정확히 세 개의 기존 이웃이있는 경우 새 포인트가 추가됩니다.
  • 기존 포인트가 기존 이웃이 3 개 이상 또는 2 개 미만인 경우 제거됩니다.

이웃이란 무엇입니까?

점 X의 이웃은 수평, 수직 또는 대각선으로 X에 인접한 점으로 정의됩니다. 포인트의 이웃 \$(2, 3)\$ 아르:

  • \$(1, 3)\$
  • \$(1, 2)\$
  • \$(2, 2)\$
  • \$(3, 2)\$
  • \$(3, 3)\$
  • \$(3, 4)\$
  • \$(2, 4)\$
  • \$(1, 4)\$

이 경우 출력은 다음과 유사해야합니다.

[[1, 0], [2, 0], [2, 1], [0, 1], [1, -1]]

직무

위의 수정 규칙에 따라 수정 된 목록을 표시하는 포인트 목록을 인쇄하거나 반환하는 프로그램을 작성하거나 함수를 구현합니다 (출력 목록의 순서는 중요하지 않음).

아, 그리고 가능한 한 짧은 코드를 만드세요! ( code-golf)

추신 : 당신의 답변에 프로그램에 대한 설명을 포함하면 좋을 것입니다!

몇 가지 예제 테스트 케이스

Example STDIN                                  Example STDOUT
[[0, 0]]                           =>          []
[[0, 0], [0, 1]]                   =>          []
[[0, 0], [0, 1], [1, 0]]           =>          [[0, 0], [0, 1], [1, 0], [1, 1]]
[[0, 0], [0, 1], [1, 0], [1, 1]]   =>          [[0, 0], [0, 1], [1, 0], [1, 1]]
[[0, 0], [0, 1], [0, -1]]          =>          [[0, 0], [1, 0], [-1, 0]]
[[1, 0], [1, 1], [1, 2]]           =>          [[2, 1], [1, 1], [0, 1]]

행운을 빕니다! :)

답변

7 Adám Sep 25 2020 at 03:01

APL (Dyalog 확장) , 34 32 바이트 ( SBCS )

익명의 암묵적인 접두사 기능. 필요합니다 ⎕IO←0(0 기반 인덱싱).

⌊/{⍺-1-⍸⌂life 0,∘⌽∘⍉⍣4⍸⍣¯1∧⍵-⍺}⊢

온라인으로 시도하십시오!

⌊/{… }⊢ 가장 작은 기존 x 및 y 좌표를 왼쪽 인수 ( ⍺)로, 전체 목록을 오른쪽 인수 ( ⍵) 로 사용 하여 다음 익명 람다를 호출합니다 .

 ⍵-⍺ 모든 점에서 가장 작은 점을 뺍니다 (모든 숫자가 음이 아니도록 조정)

 ∧ 오름차순 정렬

 ⍸⍣¯1 해당 위치에 1이있는 부울 행렬을 생성합니다 ( " ɩ ndices of 1s"의 역으로 켜짐 ).

 0… ⍣4 왼쪽 인수로 0을 사용하여 4 번 반복합니다.

  … ∘⍉ 조옮김 후

   … ∘⌽ 거울, 그러면 (이것은 시계 방향으로 90도 회전을 구성합니다)

    … , 0을 왼쪽 가장자리에 연결

 ⌂life 차세대 생명의 게임을 계산

 ⍸ ɩ ndices of 1s

 1- 1에서 빼기

 ⍺- 가장 낮은 x 및 y 좌표의 오프셋에서 빼기

7 Zgarb Sep 26 2020 at 22:46

Husk , 17 바이트

uṠfo≈6#-¹×z+π2ṡ1D

온라인으로 시도하십시오! 인터프리터는 입력에 추가 공백을 좋아하지 않습니다.

설명

uṠfo≈6#-¹×z+π2ṡ1D   Input is a list of lists, e.g. L=[[0,0],[1,0],[2,1]]
                D   Repeat twice: X=[[0,0],[1,0],[2,1],[0,0],[1,0],[2,1]]
              ṡ1    Symmetric range to 1: [-1,0,1]
            π2      Cartesian second power: [[-1,-1],[-1,0],…,[1,1]]
         ×          Pick all elements from this and X and combine with
          z+        zipping by addition: [[-1,-1],[0,-1],…,[3,2]]
       -¹           Remove one occurrence of each element of L.
                    Call the result Y.
  f                 Filter by condition:
 Ṡ    #             number of occurrences in Y
   o≈6              is close to 6 (so 5, 6 or 7).
u                   Remove duplicates: [[1,1],[1,0]]
5 DominicvanEssen Sep 27 2020 at 16:07

R , 164156 바이트

참고 : 이제 내 자신의 다른 답변에 의해 R 에서 outgolfed

function(p){m=matrix(F,u<-max(p)-(r=min(p)-2)+1,u)
m[t(p-r)]=T
t(which(m[]<-(s=sapply(1:u^2,function(j)sum(m[(j+-3:5%/%3*u+-2:0)%%u^2+1])))==3|m&s==4,T))+r}

온라인으로 시도하십시오!

2 행 행렬의 열로 좌표를 받아 반환하는 함수입니다.

행렬을 만들고 지정된 좌표에 채운 다음 다음 세대를 계산하고 채워진 요소의 인덱스를 출력하는 방식으로 작동합니다.

어떻게?

gol_points=
function(p){            # p = matrix with coords in columns
 m=matrix(F,            # create a matrix, filled with FALSE...
  u<-diff(              #  with row number u equal to the difference...
  r<-range(p))+3,       #  between the range r of values in p, plus 3,
  u)                    #  and the same number of columns
                        #  (so it's a square matrix with dimensions 1 bigger
                        #  than the largest range of p)
 m[t(p-r[1]+2)]=T       # Now, set the elements of m at coordinates p + offset to TRUE
 t(which(               # Then, return the coordinates of elements that satisfy...
  m[]<-(s=              #  m, filled with...
   sapply(1:u^2,        #   the results for each of 1..u^2 (each element of m)...
    function(j)         #   of a function taking argument j...
     sum(m[(j+          #   and returning the sum of elements of m at position j...
     -3:5%/%3*u+-2:0    #   plus the elements at all adjacent positions...
     )%%u^2             #   (modulo the matrix size u^2 to wrap-around the edges)
     +1])               #   +1 (R uses 1-based indices),
   ))==3                #  is equal to 3 (3 neighbours, or filled cell with 2 neighbours)
   |m&s==4,         #  or is itself TRUE and sum is equal to 4 (filled cell with 3 neighbours)
   T))                  # (arr.ind=TRUE = return coordinates, rather than linear indices), 
  +r[1]-2}              # minus the offset used in the first place.
3 Vole Sep 27 2020 at 06:07

Julia 1.0 , 121 91 바이트

f=g->[v for v=Set(h+[j,k] for h=g,j=-1:1,k=-1:1)if 2<sum(i->all(abs.(v-i).<2),g)<4+in(v,g)]

온라인으로 시도하십시오!

설명

f=g->[v for v=                          # Array Comprehension of final result

    Set(h+[j,k] for h=g,j=-1:1,k=-1:1)  # Set Comprehension of all neighboring cells
                                        # of occupied cells, including self
    if 2<
        sum(i->all(abs.(v-i).<2),g)     # Count the number of neighbors, including self.
                                        # For i in g, count iff the distance
                                        # between v and i is less than 2
                                        # for all dimensions

        <4+in(v,g)                      # <4 if cell is empty, <5 if occupied
]
2 DanTheMan Sep 26 2020 at 08:28

Wolfram 언어 , 92 바이트

CellularAutomaton["GameOfLife",{SparseArray[#+1-Min@#->(1&/@#)],0}][[1]]~Position~1-2+Min@#&

#+1-Min@#->(1&/@#)입력을 SparseArray에 대한 규칙으로 변환 : #+1-Min@#인덱스를 양수로 만들기 위해 적절한 시프트를 생성 (1&/@#)하고 적절한 길이의 목록을 만듭니다.

그런 다음 CellularAutomaton 에 입력되어 Conway의 Game of Life의 단계를 생성합니다. 결과를 추출하여 Position 에 입력하여 살아있는 세포의 위치를 ​​찾은 다음 인덱스 이동을 반대로합니다 -2+Min@#(CellularAutomaton이 영향을받을 수있는 모든 세포를 포함하기 위해 패딩을 추가하기 때문에 마이너스 1이 아니라 마이너스 2입니다).

온라인으로 시도하십시오!

2 Jonah Sep 27 2020 at 12:15

J , 59 바이트

(([(~.#~3=#/.~)@-.~[:,+/),[#~3 4 e.~[:+/[e."1+/)&(,j./~i:1)

온라인으로 시도하십시오!

나중에 설명합니다.

2 Noodle9 Sep 26 2020 at 15:10

파이썬 3 , 215 \$\cdots\$ 129127 바이트

att 덕분에 무려 36 바이트를 절약했습니다 !!! ovs
덕분에 2 바이트 절약 !!!

lambda l:{(a+c,b+d)for c in(-1,0,1)for d in(-1,0,1)for a,b in l if((a+c,b+d)in l)+4>sum(abs(a+c-e+(b+d-f)*1j)<2for e,f in l)>2}

온라인으로 시도하십시오!

포인트 목록을 입력하고 다음 세대를 포인트 목록으로 반환합니다.

설명 (일부 골프 전)

def f(z):               # input a list of complex numbers  

n={                     # create a set of neighbouring complex numbers
   p+                   # by adding to every point
    a+b*1j              # a vector of 
     for a in(-1,0,1)   # one left, 0, one right: all combined with each of
      for b in(-1,0,1)  # one down, 0, one up 
       for p in z};     # for all the input points

g=lambda                # create a function
   p:                   # mapping a point    
     sum(               # to the sum...   
         0<abs(a-p)<2   #     if the distance between them
                        #     is either 1 or root 2 
          for a in z)   # ...of the live points    

return[(p               # return a list of complex numbers
 for p in n             # for all the points in the neighborhood
  if g[p]==3            # if it has 3 neighbors 
   or g[p]==2and p in z]# or 2 neighbors and is alive
2 JonathanAllan Sep 28 2020 at 19:37

젤리 , 25 바이트

-r1ṗ2⁸+€Ẏċ€@Ḅe6,7,9ʋƇ,¥⁸Q

Game Of Life를 반복 한 후 동일한 결과를 산출하는 좌표 목록을 허용하는 모나 딕 링크.

온라인으로 시도하십시오!

어떻게?

-r1ṗ2⁸+€Ẏċ€@Ḅe6,7,9ʋƇ,¥⁸Q - Link: list of coordinates, A
-r1                       - -1 inclusive range 1 -> [-1,0,1]
   ṗ2                     - Cartesian power two -> [0,0] and its the eight neighbours
     ⁸+€                  - add to each of A -> list of lists of an existing cell + its neighbours
        Ẏ                 - tighten -> list of all existing cells and their neighbours
                            call this B
                      ¥⁸  - last two links as a dyad - f(B, A):
                     ,    -   pair -> [B, A]
                    Ƈ     -   filter keep those c in B for which:
                   ʋ      -     last four links as a dyad - f(c, [B, A])
         ċ€@              -       count occurrence of c in each of [B, A]
                                  -> i.e. X = [n_neighbours + is_existing, is_existing]
            Ḅ             -       convert from binary -> 2×n_neighbours+3×is_existing
              6,7,9       -       [6,7,9]
             e            -       exists in? -> i.e. is X in [[3,0],[3,1],[4,1]]?
                        Q - deduplicate
2 user Sep 28 2020 at 01:39

Scala , 151118 바이트

@Vole 의 Julia 답변 에서 가져온 항목을 사용 합니다. 그것을 찬성하십시오!

g=>for{x->y<-g
r= -1 to 1
a<-r
b<-r
n=(for(i<-r;j<-r)yield(x+a+i,y+b+j))count g
if n==3|g(x+a,y+b)&n==4}yield(x+a,y+b)

온라인으로 시도하십시오!

TIO는 119 바이트를 말하지만 , Scala 2.10 (TIO가 사용하는 버전) 이후에 추가 된. (x,y)대신 Tuple2를 추출하는 데 사용해야 하기 때문 x->y입니다.

Dotty, 117 바이트

g=>for{x->y<-g;r= -1 to 1;a<-r;b<-r;n=g.count((i,j)=>math.hypot(x+a-i,y+b-j)<2)if n==3|g(x+a,y+b)&n==4}yield(x+a,y+b)

온라인으로 시도

설명

g =>
  for {
    x -> y <- g     //For every point in the grid,
    r = -1 to 1     //Create range from -1 to 1 to use later
    a <- r          //For every a in r 
    b <- r          //For every b in r ((x+a, y+b) is a neighbor of (x,y) or (x,y) itself)
    n = (for(i <- r; j <- r)
          yield (x + a + i, y + b + j) //(x+a, y+b) and all its neighbors
        ) count g   //How many of them are in g?
    if n == 3 | g(x + a, y + b) & n == 4 //Filter the cells that'll be live next round
    //If n=3, it's live and has 2 neighbors, or it's not live and has 3 neighbors, so it'll be live next round. 
    //Otherwise, check if it's live and has 3 neighbors
  } yield (x + a, y + b)  //Yield every such point
2 DominicvanEssen Sep 30 2020 at 14:43

R , 132 (125) 122 바이트

function(x,y,n=rep(q<-x+1i*y,e=9)+-3:5%/%3+1i*-1:1,s=rowSums(outer(n,n,`==`)))list(Re(c<-unique(n[s>2&s-n%in%q<4])),Im(c))

온라인으로 시도하십시오!

내 다른 R 답변에 대한 완전히 다른 접근 방식이므로 별도로 게시하십시오.

행렬을 채우는 대신 복잡한 좌표를 조작합니다.

입력 값은 점의 x 및 y 좌표를 포함하는 2 개의 벡터입니다. 출력은 x 및 y 좌표로 구성된 2 개의 벡터를 포함하는 목록입니다.

어떻게?

gol_points=
function(x,y,               
q=x+1i*y,                   # convert x and y into complex coordinates q;
d=-3:5%/%3+1i*-1:1,         # create vector d of all differences to neighbouring cells:
                            #   (so, d = -1-i, -1, -1+i, -i, 0, i, 1-i  1, and 1+i)
n=q+rep(d,e=ncol(p)),       # n = coordinates of neighbouring cells, 
                            #   by adding d to each element of q
s=rowSums(outer(n,n,`==`)), # s = the number of copies of each element in n
                            #   and, therefore, the number of live neighbours it has (including itself) 
i=(s==3|s==4&n%in%q),       # i = indices in n of new generation of cells:
                            #   TRUE if neighbours (including self) ==3, 
                            #   or if neighbours (including self) ==4 AND it's a living cell (so: in q)
c=unique(n[i]))             # c = unique set of new generation of cells
list(Re(c),Im(c))           # output list containing Real & Imaginary parts of c
1 HyperNeutrino Sep 26 2020 at 10:05

젤리 , 39 바이트

żIAṀo-4×<2$$ 3Ḷ’p`+þẎẎQçⱮ³$SṪe-2,-,3Ʋ$Ƈ

온라인으로 시도하십시오!

이건 정말 안좋아

1 att Sep 27 2020 at 05:46

Wolfram 언어 (Mathematica) , 70 바이트

l#&@@@Cases[Tally@Array[l+#+I#2&,{3,3},-1,Join],{_,3}|{#|##&@@l,4}]

온라인으로 시도하십시오!

복소수 목록을 받아 반환합니다.

1 Arnauld Sep 27 2020 at 05:12

자바 스크립트 (ES10)  156  152 바이트

a=>a.flatMap(a=>g(a,b=[])+.5|0?b:[...b,a],g=(B,b,k=9)=>k--?g(B,b,k,g[A=[B[0]+k%3-1,B[1]+~-(k/3)]]|a.some(a=>k=a+''==A)|!b||g(B=A)?0:g[B]=b.push(B))-k:3)

온라인으로 시도하십시오!

어떻게?

도우미 기능 \$g\$수를 센다 \$N\$참조 위치 주변의 셀 수 B[] = [x,y]. 골프를 치는 이유로 기준 위치도 계산됩니다. \에서 반환 된 값$g\$이다 \$3-N\$. 따라서:

  • \$g\$반환 \$0\$또는 \$-1\$\로 둘러싸인 셀$2\$또는 \$3\$ 다른 세포는 각각 (g() + 0.5 | 0) == 0
  • \$g\$반환 \$0\$정확히 \로 둘러싸인 빈 위치$3\$ 세포

두 번째 인수로 호출 b[]되면 \$g\$ 또한 현재 꺼져 있고 켜져 있어야하는 모든 셀의 좌표를이 배열에 푸시합니다.

댓글 작성

a =>                          // a[] = input array
a.flatMap(a =>                // for each coordinate pairs a[] in a[]:
  g(a, b = [])                //   invoke g with an empty array b[]
  + .5 | 0 ?                  //   if the result is neither -1 or 0:
    b                         //     return b[] without a[]
  :                           //   else:
    [...b, a],                //     return b[] with a[]
  g = (                       //   g is a recursive function taking:
    B,                        //     B[] = [x, y]
    b,                        //     b[] = list of coordinate pairs
    k = 9                     //     k = counter
  ) =>                        //
    k-- ?                     //     decrement k; if it was not 0:
      g(                      //       recursive call:
        B, b, k,              //         pass B[], b[] and k unchanged
        g[                    //
          A = [               //         define the coordinates A[] of the neighbor:
            B[0] + k % 3 - 1, //           x' = x + (k mod 3) - 1
            B[1] + ~-(k / 3)  //           y' = y + floor(k / 3) - 1
          ]                   //
        ] |                   //         abort if g[A] is already defined
        a.some(a =>           //         or A[] exists in a[]
          k = a + '' == A     //         (in which case k is set to true)
        )                     //
        | !b                  //         or b is not defined
        || g(B = A)           //         otherwise, invoke g with B = A and without
        ?                     //         the 2nd argument; if the result is not 0:
          0                   //           do nothing
        :                     //         else:
          g[B] = b.push(B)    //           append B[] to b[] and set g[B]
      ) - k                   //       end of recursive call; subtract k
    :                         //     else:
      3                       //       return 3 and stop the recursion
)                             // end of flatMap()
1 KevinCruijssen Sep 28 2020 at 23:11

05AB1E , 30 바이트

2и2Ý<©ãδ+€`D€»DI€»õ.;s¢®6+såÏê

@Zgarb Husk의 포트가 대답 하므로 그 에게도 찬성 투표 를해야합니다.
훨씬 더 긴 이유는 덜 편리한 내장 기능 때문입니다. 하나는 remove_first 빌트인이 없기 때문에 대신 replace_first 빌트인을 사용할 것입니다. 또한 개수는 쌍 목록에서 벡터화되지 않으므로 replace_first 및 count 내장 기능 모두에 대해 줄 바꿈 구분 기호로 각 문자열을 결합해야합니다.

온라인으로 시도 하거나 모든 테스트 사례를 확인하십시오 .

설명:

2и                  # Repeat the (implicit) input-list twice
                    #  i.e. [[0,0],[1,0],[2,1]] → [[0,0],[1,0],[2,1],[0,0],[1,0],[2,1]]
  2Ý                # Push list [0,1,2]
    <               # Decrease each by 1: [-1,0,1]
     ©              # Store this list in variable `®` (without popping)
      ã             # Take the cartesian product of this list with itself
                    #  → [[-1,-1],[-1,0],[-1,1],[0,-1],[0,0],[0,1],[1,-1],[1,0],[1,1]]
       δ            # Apply double vectorized on the two lists:
        +           #  Add the values at the same positions in the pairs together
                    #   → [[[-1,-1],[-1,0],[-1,1],[0,-1],[0,0],[0,1],[1,-1],[1,0],[1,1]],
                    #      [[0,-1],[0,0],[0,1],[1,-1],[1,0],[1,1],[2,-1],[2,0],[2,1]],
                    #      [[1,0],[1,1],[1,2],[2,0],[2,1],[2,2],[3,0],[3,1],[3,2]],
                    #      [[-1,-1],[-1,0],[-1,1],[0,-1],[0,0],[0,1],[1,-1],[1,0],[1,1]],
                    #      [[0,-1],[0,0],[0,1],[1,-1],[1,0],[1,1],[2,-1],[2,0],[2,1]],
                    #      [[1,0],[1,1],[1,2],[2,0],[2,1],[2,2],[3,0],[3,1],[3,2]]]
         €`         # Flatten it one level down to a list of pairs
D                   # Duplicate this list of pairs
 €»                 # Join each inner pair together with a newline delimiter
                    #  → ["1\n1","1\n0","1\n-1","0\n1","0\n0","0\n-1","-1\n1","-1\n0",
                    #     "-1\n-1","2\n1","2\n0","2\n-1","1\n1","1\n0","1\n-1","0\n1",
                    #     "0\n0","0\n-1","3\n2","3\n1","3\n0","2\n2","2\n1","2\n0",
                    #     "1\n2","1\n1","1\n0","1\n1","1\n0","1\n-1","0\n1","0\n0",
                    #     "0\n-1","-1\n1","-1\n0","-1\n-1","2\n1","2\n0","2\n-1","1\n1",
                    #     "1\n0","1\n-1","0\n1","0\n0","0\n-1","3\n2","3\n1","3\n0",
                    #     "2\n2","2\n1","2\n0","1\n2","1\n1","1\n0"]
   D                # Duplicate this list of strings
    I               # Push the input list of pairs
     €»             # Join each inner pair with a newline delimiter as well
                    #  → ["0\n0","1\n0","2\n1"]
       õ.;          # Replace every first occurrence of the input-pair with an empty string
                    #  → ["1\n1","","1\n-1","0\n1","","0\n-1","-1\n1","-1\n0",
                    #     "-1\n-1","","2\n0","2\n-1","1\n1","1\n0","1\n-1","0\n1",
                    #     "0\n0","0\n-1","3\n2","3\n1","3\n0","2\n2","2\n1","2\n0",
                    #     "1\n2","1\n1","1\n0","1\n1","1\n0","1\n-1","0\n1","0\n0",
                    #     "0\n-1","-1\n1","-1\n0","-1\n-1","2\n1","2\n0","2\n-1","1\n1",
                    #     "1\n0","1\n-1","0\n1","0\n0","0\n-1","3\n2","3\n1","3\n0",
                    #     "2\n2","2\n1","2\n0","1\n2","1\n1","1\n0"]
          s         # Swap so the other list of strings is at the top of the stack again
           ¢        # Count the amount of occurrences of each item
                    #  → [6,3,4,4,3,4,2,2,2,3,4,2,6,5,4,4,3,4,2,2,2,2,3,4,2,6,5,6,5,4,4,
                    #     3,4,2,2,2,3,4,2,6,5,4,4,3,4,2,2,2,2,3,4,2,6,5]
            ®       # Push list [-1,0,1] from variable `®`
             6+     # Add 6 to each: [5,6,7]
               s    # Swap so the list of counts are at the top of the stack
                å   # Check for each count if it occurs in the [5,6,7] list
                    #  → [1,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,
                    #     0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1]
                 Ï  # Only keep the pairs at the truthy indices
                    #  → [[1,1],[1,1],[1,0],[1,1],[1,0],[1,1],[1,0],[1,1],[1,0],[1,1],[1,0]]
                  ê # Sort and uniquify the remaining pairs
                    #  → [[1,0],[1,1]]
                    # (after which the result is output implicitly)
1 Neil Sep 28 2020 at 19:25

차콜 , 80 75 48 43 바이트

F³F³F⊕⌈↔⊖⟦ικ⟧Fθ⊞υ⊖Eμ⁺ν⎇ξκιIΦυ∧⁼κ⌕υι›²↔⁻⁶№υι

온라인으로 시도하십시오! 링크는 자세한 코드 버전입니다. @Zgarb의 Husk 대답의 지루한 포트입니다. Charcoal의 기본 형식을 사용하여 포인트를 출력합니다.이 형식은 각 좌표가 서로 두 배 간격 인 포인트가있는 자체 라인에 있습니다. 설명:

F³F³

모든 이웃을 순환하십시오.

F⊕⌈↔⊖⟦ικ⟧

인접한 셀을 두 번 반복하지만 셀 자체는 한 번만 반복합니다.

Fθ⊞υ⊖Eμ⁺ν⎇ξκι

모든 결과 셀을 미리 정의 된 빈 목록으로 푸시합니다.

IΦυ∧⁼κ⌕υι›²↔⁻⁶№υι

5 번에서 7 번 사이에 나타나는 셀의 첫 번째 모습을 인쇄합니다.

이전 80 75 바이트 이상의 Charcoal-y 솔루션 :

≔E²Eθ§λιηUMη…·⊖⌊ι⊕⌈ιFθ«J⊟ι⊟ιUMKMI⌊⟦⁹⁺²Σκ⟧I⊕ΣKK»F⊟ηF§η⁰«Jικ¿№567KK⊞υ⟦κι⟧»⎚Iυ

온라인으로 시도하십시오! 링크는 자세한 코드 버전입니다. Charcoal의 기본 형식을 사용하여 포인트를 출력합니다.이 형식은 각 좌표가 서로 두 배 간격 인 포인트가있는 자체 라인에 있습니다. 설명:

≔E²Eθ§λιη

포인트의 전치 사본을 가져옵니다.

UMη…·⊖⌊ι⊕⌈ι

전치의 각 행을 패딩 된 범위로 바꿉니다.

Fθ«

각 지점을 반복합니다.

J⊟ι⊟ι

그 지점으로 이동하십시오.

UMKMI⌊⟦⁹⁺²Σκ⟧

9 개로 제한하여 각 이웃을 두 배로 늘립니다.

I⊕ΣKK

셀을 늘립니다.

»F⊟ηF§η⁰«

패딩 된 범위를 반복합니다.

Jικ

그 지점으로 이동하십시오.

¿№567KK

5에서 7 사이라면 ...

⊞υ⟦κι⟧

... 미리 정의 된 빈 목록에 해당 지점을 저장합니다.

»⎚Iυ

캔버스를 지우고 새 포인트를 출력합니다.