 Rem File: Cmd160.bas
 Rem Sub: Link.Room
 Rem $Include: 'dndbbs.inc'
 On Error Goto Main.Error
 If Chained<>-2 Then
    Color 15,0
    Print "DNDBBS Command 160 -- Link.Room."
    Color 7,0
    End
 Endif
 Call Link.Room
Main.Resume:
 Local.Mode=Remote
 Chain DND.Path+"DNDBBS.EXE"
 End
Main.Error:
 Resume Main.Resume

Sub Link.Room
 On Local Error Goto ErrorTrap29
 Do While Lost.Carrier=False
    Graphics.Off=False
    Strng="Roomlink Edit utility v"+Left$(Version$,4)+" menu:"
    Call IO.O
    Graphics.Off=True
    Strng="[A]dd link"
    Call IO.O
    Strng="[C]heck links"
    Call IO.O
    Strng="[D]elete link"
    Call IO.O
    Strng="[L]ist links"
    Call IO.O
    Strng="[S]earch links"
    Call IO.O
    Strng="[X]Square link"
    Call IO.O
    Strng="[Y]Diamond link"
    Call IO.O
    Graphics.Off=False
    No.Input.Out="Q"
    Strng="Enter command(q to quit)? "
    Call IO.I
    Select Case Ucase$(Out2)
    Case "A"
       Strng="Enter room(1-"+Mid$(Str$(Lof(RoomFile)/RoomRecLen),2)+")? "
       Call IO.I
       Var1!=Int(Val(Out2))
       If Var1!>False And Var1!<=Lof(RoomFile)/RoomRecLen Then
          Strng="Enter link room(1-"+Mid$(Str$(Lof(RoomFile)/RoomRecLen),2)+")? "
          Call IO.I
          Var2!=Int(Val(Out2))
          If Var2!>False And Var2!<=Lof(RoomFile)/RoomRecLen Then
             Temp3=False
             Strng="Enter direction(N,E,S,W,NE,SE,SW,NW,U,D,I,O,1,2)? "
             Call IO.I
             Call Find.Link(Out2)
             If Temp3 Then
                Call Read.Record(RoomFile,Var1!)
                RoomRecord.Direct(Temp3)=Var2!
                Call Write.Record(RoomFile,Var1!)
                Strng="Room"+Str$(Var1!)+" link added to room"+Str$(Var2!)+"."
                Call IO.O
                If Temp3=13 Then
                   Strng="Enter custom direction: "
                   Call IO.I
                   RoomRecord.Custom1=Ucase$(Out2)
                   Call Write.Record(RoomFile,Var1!)
                Else
                   If Temp3=14 Then
                      Strng="Enter custom direction: "
                      Call IO.I
                      RoomRecord.Custom2=Ucase$(Out2)
                      Call Write.Record(RoomFile,Var1!)
                   Else
                      Strng="Link room"+Str$(Var2!)+" back to room"+Str$(Var1!)+"(y/n)? "
                      Call IO.I
                      If Yes Then
                         Call Find.Back.Link(Temp3)
                         If Temp4 Then
                            Call Read.Record(RoomFile,Var2!)
                            RoomRecord.Direct(Temp4)=Var1!
                            Call Write.Record(RoomFile,Var2!)
                            Strng="Room"+Str$(Var2!)+" link added back to room"+Str$(Var1!)+"."
                            Call IO.O
                         Endif
                      Endif
                   Endif
                Endif
             Endif
          Endif
       Endif
    Case "D"
       Strng="Enter room(1-"+Mid$(Str$(Lof(RoomFile)/RoomRecLen),2)+")? "
       Call IO.I
       Var1!=Int(Val(Out2))
       If Var1!>False And Var1!<=Lof(RoomFile)/RoomRecLen Then
          Strng="Enter direction(N,E,S,W,NE,SE,SW,NW,U,D,I,O,1,2)? "
          Call IO.I
          Call Find.Link(Out2)
          If Temp3 Then
             Call Read.Record(RoomFile,Var1!)
             RoomRecord.Direct(Temp3)=SFalse
             If Temp3=13 Then
                RoomRecord.Custom1=Nul
             Endif
             If Temp3=14 Then
                RoomRecord.Custom2=Nul
             Endif
             Call Write.Record(RoomFile,Var1!)
             Strng="Room"+Str$(Var1!)+" link removed."
             Call IO.O
          Endif
       Endif
    Case "L"
       Var3!=Lof(RoomFile)/RoomRecLen
       Call Get.Room.Range(Var1!,Var2!,Var3!)
       Allow.Break=True
       Break=False
       Continuous=False
       Temp6=False
       For Temp!=Var1! To Var2!
          Call Read.Record(RoomFile,Temp!)
          For VarQ=1 To 4
             Call Display.Link(VarQ)
             If Break Then
                Exit For
             Endif
          Next
          If Break Then
             Exit For
          Endif
          Temp6=Temp6+4
          If Temp6>=20 Then
             Temp6=False
             If Continuous=False Then
                Call More.Prompt
                If No Or Quit Then
                   Exit For
                Endif
             Endif
          Endif
       Next
       Allow.Break=False
       Break=False
       If Temp6 Then
          Call More.Prompt
       Endif
    Case "S"
       Var1!=SFalse
       Var2!=SFalse
       Do While Lost.Carrier=False
          Graphics.Off=True
          Strng="[A]room link"
          If Var1! Then
             Strng=Strng+Space$(30-Len(Strng))
             Strng=Strng+"("+Mid$(Str$(Var1!),2)+")"
          Endif
          Call IO.O
          Strng="[B]room link and back"
          If Var2! Then
             Strng=Strng+Space$(30-Len(Strng))
             Strng=Strng+"("+Mid$(Str$(Var2!),2)+")"
          Endif
          Call IO.O
          Graphics.Off=False
          Strng="Room link search option(S to search, Q to quit)? "
          No.Input.Out="Q"
          Call IO.I
          Temp3=Lof(RoomFile)/RoomRecLen
          Temp$=Mid$(Str$(Temp3),2)
          Select Case Ucase$(Out2)
          Case "A"
             Strng="Room link number? "
             Call IO.I
             Var1!=Int(Val(Out2))
          Case "B"
             Strng="Room link number? "
             Call IO.I
             Var2!=Int(Val(Out2))
          Case "S"
             Allow.Break=True
             Break=False
             Continuous=False
             Var!=Lof(RoomFile)/RoomRecLen
             Call Get.Room.Range(VarS1!,VarS2!,Var!)
             For Temp!=VarS1! To VarS2!
                Call Read.Record(RoomFile,Temp!)
                TempX=False
                If RoomRecord.Direct(13)=Var3! Then
                   TempX=True
                Endif
                If RoomRecord.Direct(14)=Var3! Then
                   TempX=True
                Endif
                For Temp4=1 To MaxDirections
                   If Var1! Then
                      If RoomRecord.Direct(Temp4)=Var1! Then
                         TempX=True
                         Exit For
                      Endif
                   Endif
                   If Var2! Then
                      If RoomRecord.Direct(Temp4)=Var2! Then
                         Select Case Temp4
                         Case 1
                            Temp8=3
                         Case 2
                            Temp8=4
                         Case 3
                            Temp8=1
                         Case 4
                            Temp8=2
                         Case 5
                            Temp8=7
                         Case 6
                            Temp8=8
                         Case 7
                            Temp8=5
                         Case 8
                            Temp8=6
                         Case 9
                            Temp8=10
                         Case 10
                            Temp8=9
                         Case 11
                            Temp8=12
                         Case 12
                            Temp8=11
                         End Select
                         Call Read.Record(RoomFile,Var2!)
                         If RoomRecord.Direct(Temp8)=Temp! Then
                            TempX=True
                         Endif
                         Call Read.Record(RoomFile,Temp!)
                         If TempX Then
                            Exit For
                         Endif
                      Endif
                   Endif
                Next
                If TempX Then
                   For VarQ=1 To 4
                      Call Display.Link(VarQ)
                      If Break Then
                         Exit For
                      Endif
                   Next
                   If Break Then
                      Exit For
                   Endif
                   If Continuous=False Then
                      Call More.Prompt
                      If No Or Quit Then
                         Exit For
                      Endif
                   Endif
                Endif
             Next
             Allow.Break=False
             Break=False
             Var1!=SFalse
             Var2!=SFalse
          Case "Q"
             Exit Do
          End Select
       Loop
    Case "X"
       Restore Square.Data
       Strng="Enter room(1-"+Mid$(Str$(Lof(RoomFile)/RoomRecLen),2)+")? "
       Call IO.I
       Var1!=Int(Val(Out2))
       If Var1!>False And Var1!<=Lof(RoomFile)/RoomRecLen Then
          VarN=False
          For VarX=1 To 8
             Read Var1,Var2,Var3,Var4
             Call Read.Record(RoomFile,Var1!)
             Do
                VarX!=RoomRecord.Direct(Var1)
                If VarX!<=SFalse Or VarX!>Lof(RoomFile)/RoomRecLen Then
                   Exit Do
                Endif
                Call Read.Record(RoomFile,VarX!)
                VarY!=RoomRecord.Direct(Var2)
                If VarY!<=SFalse Or VarY!>Lof(RoomFile)/RoomRecLen Then
                   Exit Do
                Endif
                Call Read.Record(RoomFile,VarY!)
                VarZ!=RoomRecord.Direct(Var3)
                If VarZ!<=SFalse Or VarZ!>Lof(RoomFile)/RoomRecLen Then
                   Exit Do
                Endif
                Call Read.Record(RoomFile,VarZ!)
                Call Find.Back.Link(Var4)
                If RoomRecord.Direct(Var4)=False Then
                   Call Read.Record(RoomFile,Var1!)
                   If RoomRecord.Direct(Temp4)=False Then
                      Call Read.Record(RoomFile,VarZ!)
                      RoomRecord.Direct(Var4)=Var1!
                      Call Write.Record(RoomFile,VarZ!)
                      Call Read.Record(RoomFile,Var1!)
                      RoomRecord.Direct(Temp4)=VarZ!
                      Call Write.Record(RoomFile,Var1!)
                      VarN=VarN+1
                   Endif
                Endif
                Exit Do
             Loop
          Next
          Select Case VarN
          Case False
             Strng="No square room links found."
          Case Else
             Strng=Rtrim$(Numeral(VarN))
             Mid$(Strng,1,1)=Ucase$(Mid$(Strng,1,1))
             If VarN=1 Then
                Strng=Strng+" square room linked."
             Else
                Strng=Strng+" square rooms linked."
             Endif
          End Select
          Call IO.O
       Endif
    Case "Y"
       Restore Diamond.Data
       Strng="Enter room(1-"+Mid$(Str$(Lof(RoomFile)/RoomRecLen),2)+")? "
       Call IO.I
       Var1!=Int(Val(Out2))
       If Var1!>False And Var1!<=Lof(RoomFile)/RoomRecLen Then
          VarN=False
          For VarX=1 To 8
             Read Var1,Var2,Var3,Var4
             Call Read.Record(RoomFile,Var1!)
             Do
                VarX!=RoomRecord.Direct(Var1)
                If VarX!<=SFalse Or VarX!>Lof(RoomFile)/RoomRecLen Then
                   Exit Do
                Endif
                Call Read.Record(RoomFile,VarX!)
                VarY!=RoomRecord.Direct(Var2)
                If VarY!<=SFalse Or VarY!>Lof(RoomFile)/RoomRecLen Then
                   Exit Do
                Endif
                Call Read.Record(RoomFile,VarY!)
                VarZ!=RoomRecord.Direct(Var3)
                If VarZ!<=SFalse Or VarZ!>Lof(RoomFile)/RoomRecLen Then
                   Exit Do
                Endif
                Call Read.Record(RoomFile,VarZ!)
                Call Find.Back.Link(Var4)
                If RoomRecord.Direct(Var4)=False Then
                   Call Read.Record(RoomFile,Var1!)
                   If RoomRecord.Direct(Temp4)=False Then
                      Call Read.Record(RoomFile,VarZ!)
                      RoomRecord.Direct(Var4)=Var1!
                      Call Write.Record(RoomFile,VarZ!)
                      Call Read.Record(RoomFile,Var1!)
                      RoomRecord.Direct(Temp4)=VarZ!
                      Call Write.Record(RoomFile,Var1!)
                      VarN=VarN+1
                   Endif
                Endif
                Exit Do
             Loop
          Next
          Select Case VarN
          Case False
             Strng="No diamond room links found."
          Case Else
             Strng=Rtrim$(Numeral(VarN))
             Mid$(Strng,1,1)=Ucase$(Mid$(Strng,1,1))
             If VarN=1 Then
                Strng=Strng+" diamond room linked."
             Else
                Strng=Strng+" diamond rooms linked."
             Endif
          End Select
          Call IO.O
       Endif
    Case "C"
       Strng="Check missing links(y/n)?"
       Call IO.I
       If Yes Then
          Strng="Checking room links.."
          Call IO.O
          Temp1 = False
          Temp2 = False
          FOR Var! = 1! TO LOF(RoomFile) / RoomRecLen
             FOR TempZ = 1 TO 8
                Call Read.Record(RoomFile, Var!)
                Var1! = RoomRecord.Direct(TempZ)
                IF Var1! > 0! And Var1! <= Lof(RoomFile)/RoomRecLen THEN
                   Call Read.Record(RoomFile, Var1!)
                   CALL Find.Back.Link(TempZ)
                   IF Temp4 THEN
                      Var2! = RoomRecord.Direct(Temp4)
                      IF Var2! <> Var! THEN
                         Strng = "Room#" + STR$(Var!) + ": "
                         Strng = Strng + Lcase$(Rtrim$(Direction(TempZ)))
                         Call IO.O
                         Temp2 = True
                         Temp1 = Temp1 + 1
                         If Temp1>=User.Pagelength-2 Then
                            Temp1 = False
                            Call More.Prompt
                         Endif
                      END IF
                   END IF
                END IF
             NEXT
          NEXT
          If Temp2 = False Then
             Strng= "No bad links found."
             Call IO.O
             Call More.Prompt
          Else
             If Temp1 Then
                Call More.Prompt
             Endif
          Endif
       Endif
       Strng="Check custom links(y/n)?"
       Call IO.I
       If Yes Then
          Strng="Enter node number(<enter>,0-9,A-Z,10-99)?"
          Call IO.I
          FileName=Nul
          Select Case Len(Out2)
          Case 0
             FileName="DND"
          Case 1
             Select Case Ucase$(Out2)
             Case "0" To "9"
                FileName="DND"+Ucase$(Out2)
             Case "A" To "Z"
                FileName="DND"+Ucase$(Out2)
             End Select
          Case 2
             VarX=Int(Val(Out2))
             If VarX>=10 And VarX<=99 Then
                FileName="DND"+Mid$(Str$(VarX),2)
             Endif
          End Select
          If FileName=Nul Then
             Strng="Filename not found."
             Call IO.O
          Else
             FileName=DND.Path+FileName+".CFG"
             If Dir$(FileName)=Nul Then
                Strng="Filename '"+Filename+"' not found."
                Call IO.O
             Else
                Close #TempFile1
                Open FileName For Input Shared As #TempFile1
                Temp3=MaxUserCommands*3
                Redim Temp.ArrayS(1 To Temp3) As String
                Temp3=False
                For Temp1=1 To MaxConfigArray1
                   Input #TempFile1,Var!
                Next
                For Temp1=1 To MaxConfigArray2
                   Input #TempFile1,Var%
                Next
                For Temp1=1 To MaxConfigArray3
                   Line Input #TempFile1,Var$
                   Select Case Temp1
                   Case 9 ' DM command
                      Var1$=Rtrim$(Var$)
                   Case 78 ' node command
                      Var2$=Rtrim$(Var$)
                   Case 79 ' Sysop command
                      Var3$=Rtrim$(Var$)
                   Case 85 ' ANSI prefix
                      Var4$=Rtrim$(Var$)
                   End Select
                Next
                For Temp1=1 To 40
                   Input #TempFile1,Var%
                Next
                For Temp1=1 To 87
                   Line Input #TempFile1,Var$
                Next
                For Temp1=1 To MaxUserCommands
                   Line Input #TempFile1,Var$
                   For Temp2=1 To 3
                      Line Input #TempFile1,Var$
                      If Var$="<>" Or Rtrim$(Var$)=Nul Then
                         Eat$ = Nul
                      Else
                         Temp3=Temp3+1
                         Temp.ArrayS(Temp3)=Var$
                      Endif
                   Next
                   For Temp2=1 To 15
                      Input #TempFile1,Var%
                   Next
                Next
                Close #TempFile1
                Strng="Checking custom links.."
                Call IO.O
                Temp1=False
                Temp2=False
                For Var!=1! To Lof(RoomFile)/RoomRecLen
                   Call Read.Record(RoomFile,Var!)
                   Var$=RoomRecord.Custom1
                   Var$=Ucase$(Rtrim$(Var$))
                   For Temp4=1 To Temp3
                      If Var$=Ucase$(Temp.ArrayS(Temp4)) Then
                         Strng="Custom direction1 '"+Var$+"' in room#"+ _
                         Mid$(Str$(Var!),2)+" conflicts with command."
                         Gosub Display.Line
                      Endif
                   Next
                   If Len(Var1$) Then
                      If Left$(Var$,Len(Var1$))=Var1$ Then
                         Strng="Custom direction1 '"+Var$+"' in room#"+ _
                         Mid$(Str$(Var!),2)+" conflicts with "+Var1$+" prefix."
                         Gosub Display.Line
                      Endif
                   Endif
                   If Len(Var2$) Then
                      If Left$(Var$,Len(Var2$))=Var2$ Then
                         Strng="Custom direction1 '"+Var$+"' in room#"+ _
                         Mid$(Str$(Var!),2)+" conflicts with "+Var2$+" prefix."
                         Gosub Display.Line
                      Endif
                   Endif
                   If Len(Var3$) Then
                      If Left$(Var$,Len(Var3$))=Var3$ Then
                         Strng="Custom direction1 '"+Var$+"' in room#"+ _
                         Mid$(Str$(Var!),2)+" conflicts with "+Var3$+" prefix."
                         Gosub Display.Line
                      Endif
                   Endif
                   If Len(Var4$) Then
                      If Instr(Var$,Var4$) Then
                         Strng="Custom direction1 '"+Var$+"' in room#"+ _
                         Mid$(Str$(Var!),2)+" conflicts with "+Var4$+" prefix."
                         Gosub Display.Line
                      Endif
                   Endif
                   If Instr(Var$,"[") Then
                      Strng="Custom direction1 '"+Var$+"' in room#"+ _
                      Mid$(Str$(Var!),2)+" conflicts with [ prefix."
                      Gosub Display.Line
                   Endif
                   Var$=RoomRecord.Custom2
                   Var$=Ucase$(Rtrim$(Var$))
                   For Temp4=1 To Temp3
                      If Var$=Ucase$(Temp.ArrayS(Temp4)) Then
                         Strng="Custom direction2 '"+Var$+"' in room#"+ _
                         Mid$(Str$(Var!),2)+" conflicts with command."
                         Gosub Display.Line
                      Endif
                   Next
                   If Len(Var1$) Then
                      If Left$(Var$,Len(Var1$))=Var1$ Then
                         Strng="Custom direction2 '"+Var$+"' in room#"+ _
                         Mid$(Str$(Var!),2)+" conflicts with "+Var1$+" prefix."
                         Gosub Display.Line
                      Endif
                   Endif
                   If Len(Var2$) Then
                      If Left$(Var$,Len(Var2$))=Var2$ Then
                         Strng="Custom direction2 '"+Var$+"' in room#"+ _
                         Mid$(Str$(Var!),2)+" conflicts with "+Var2$+" prefix."
                         Gosub Display.Line
                      Endif
                   Endif
                   If Len(Var3$) Then
                      If Left$(Var$,Len(Var3$))=Var3$ Then
                         Strng="Custom direction2 '"+Var$+"' in room#"+ _
                         Mid$(Str$(Var!),2)+" conflicts with "+Var3$+" prefix."
                         Gosub Display.Line
                      Endif
                   Endif
                   If Len(Var4$) Then
                      If Instr(Var$,Var4$) Then
                         Strng="Custom direction2 '"+Var$+"' in room#"+ _
                         Mid$(Str$(Var!),2)+" conflicts with "+Var4$+" prefix."
                         Gosub Display.Line
                      Endif
                   Endif
                   If Instr(Var$,"[") Then
                      Strng="Custom direction2 '"+Var$+"' in room#"+ _
                      Mid$(Str$(Var!),2)+" conflicts with [ prefix."
                      Gosub Display.Line
                   Endif
                Next
                If Temp2=False Then
                   Strng="No bad custom directions found."
                   Call IO.O
                   Call More.Prompt
                Else
                   If Temp1 Then
                      Call More.Prompt
                   Endif
                Endif
                Redim Temp.ArrayS(1 To 1) As String
             Endif
          Endif
       Endif
    Case "Q"
       Exit Do
    End Select
 Loop
 Exit Sub
Display.Line:
 Call IO.O
 Temp2 = True
 Temp1 = Temp1 + 1
 If Temp1>=User.Pagelength-2 Then
    Temp1 = False
    Call More.Prompt
 Endif
 Return
ErrorResume29:
 Exit Sub
ErrorTrap29:
 Resume ErrorResume29
End Sub

Sub Get.Room.Range(Var1!,Var2!,VarX!)
 On Local Error Goto Error.Trap4
 Strng="Enter range:"
 Call IO.O
 Var$=Mid$(Str$(VarX!),2)
 Strng="From(1-"+Var$+")? "
 No.Input.Out="1"
 Call IO.I
 Var1!=Int(Val(Out2))
 If Var1!<1 Then
    Var1!=1
 Endif
 If Var1!>VarX! Then
    Var1!=VarX!
 Endif
 Strng="To("+Mid$(Str$(Var1!),2)+"-"+Var$+")? "
 No.Input.Out=Var$
 Call IO.I
 Var2!=Int(Val(Out2))
 If Var2!<Var1! Then
    Var2!=Var1!
 Endif
 If Var2!>VarX! Then
    Var2!=VarX!
 Endif
Error.Resume4:
 Exit Sub
Error.Trap4:
 Resume Error.Resume4
End Sub

Sub Display.Link(Var)
 On Local Error Goto Error.Trap5
 Graphics.Off=True
 Select Case Var
 Case 1
 Strng="Room number"+Str$(Temp!)+":"
 Call IO.O
 Case 2
 Strng=Nul
 For Temp3=1 To 4
    Out2=Direction(Temp3)+Str$(RoomRecord.Direct(Temp3))
    Strng=Strng+Out2+Space$(20-Len(Out2))
 Next
 Strng=Rtrim$(Strng)
 Call IO.O
 Case 3
 Strng=Nul
 For Temp3=5 To 8
    Out2=Direction(Temp3)+Str$(RoomRecord.Direct(Temp3))
    Strng=Strng+Out2+Space$(20-Len(Out2))
 Next
 Strng=Rtrim$(Strng)
 Call IO.O
 Case 4
 Strng=Nul
 For Temp3=9 To 12
    Out2=Direction(Temp3)+Str$(RoomRecord.Direct(Temp3))
    Strng=Strng+Out2+Space$(20-Len(Out2))
 Next
 Strng=Rtrim$(Strng)
 Call IO.O
 Strng=Nul
 Var$=Rtrim$(RoomRecord.Custom1)
 If Var$=String$(12,Chr$(0)) Then
    Var$=Nul
 Endif
 If Len(Var$) Then
    If RoomRecord.Direct(13)>SFalse Then
       Strng="Custom1: "+Lcase$(Var$)+" ="+Str$(RoomRecord.Direct(13))+" "
    Endif
 Endif
 Var$=Rtrim$(RoomRecord.Custom2)
 If Var$=String$(12,Chr$(0)) Then
    Var$=Nul
 Endif
 If Len(Var$) Then
    If RoomRecord.Direct(14)>SFalse Then
       Strng=Strng+"Custom2: "+Lcase$(Var$)+" ="+Str$(RoomRecord.Direct(14))
    Endif
 Endif
 If Len(Strng) Then
    Call IO.O
 Endif
 End Select
Error.Resume5:
 Exit Sub
Error.Trap5:
 Resume Error.Resume5
End Sub

Square.Data:
 ' east-north-west-south
 Data 2,1,4,3
 ' west-north-east-south
 Data 4,1,2,3
 ' east-south-west-north
 Data 2,3,4,1
 ' west-south-east-north
 Data 4,3,2,1
 ' north-east-south-west
 Data 1,2,3,4
 ' south-east-north-west
 Data 3,2,1,4
 ' north-west-south-east
 Data 1,4,3,2
 ' south-west-north-east
 Data 3,4,1,2

Diamond.Data:
 ' northeast-southeast-southwest-northwest
 Data 5,6,7,8
 ' northeast-northwest-southwest-southeast
 Data 5,8,7,6
 ' northwest-northeast-southeast-southwest
 Data 8,5,6,7
 ' northwest-southwest-southeast-northeast
 Data 8,7,6,5
 ' southeast-southwest-northwest-northeast
 Data 6,7,8,5
 ' southeast-northeast-northwest-southwest
 Data 6,5,8,7
 ' southwest-northwest-northeast-southeast
 Data 7,8,5,6
 ' southwest-southeast-northeast-northwest
 Data 7,6,5,8
