2013年6月5日水曜日

U search memoramdum (8) column_fish_room_division

jnn matrix のすべての組み合わせに対して、room_selection マクロにてswordfish として成立する組み合わせを選別して次のマクロに入る。
選別されたmatrixの形は、 ( f(i), d(j) ) で表される。

 column_fish_room_divisionマクロ

該当するswordfish の組み合わせをOUTPUTする。



  cnum = 19 + i6

Sheets("Sheet8").Cells(19, 54) = "number/room"
'
Sheets("Sheet8").Cells(cnum, 51) = Sheets("Sheet1").Range("D2")
Sheets("Sheet8").Cells(cnum, 52) = flagM
Sheets("Sheet8").Cells(cnum, 54) = nb & " ( " & room & ")"
 aa = ""
For i7 = 1 To room
 d(i7) = jnn(0, i7)
 aa = aa & jnn(0, i7)
Next i7
Sheets("Sheet8").Cells(cnum, 53) = aa

 knum = 0
 For i8 = 1 To z
  If jnn(i8, room + 1) <> 0 Then
  knum = knum + 1
  f(knum) = jnn(i8, 0)
Sheets("Sheet8").Cells(cnum, 54 + knum) = jnn(i8, 0)
  End If
Next i8
'
candy matrix より、swordfish を構成する候補数字を消去する。

empty_cell = Sheets("Sheet1").Range("K2")
For i6 = 1 To knum
If Left(f(i6), 1) = "C" Then
    x2 = Int(Right(f(i6), 1))
   For i7 = 1 To empty_cell
  
      For j8 = 1 To knum
       x1 = Int(Right(d(j8), 1))
    If can(i7, 2) = x1 Then GoTo conti77
      Next j8
  
    If can(i7, 3) = x2 Then
     ikumi = can(i7, 5)
            For j3 = 1 To ikumi
              If nb = can(i7, 5 + j3) Then
                 For k1 = j3 To ikumi
                 can(i7, 5 + k1) = can(i7, 6 + k1)
                 Next k1
                can(i7, 5) = ikumi - 1
                can(i7, 5 + ikumi) = ""
                Exit For
              End If
            Next j3
      End If
conti77:
   Next i7
ElseIf Left(f(i6), 1) = "R" Then
    x1 = Int(Right(f(i6), 1))
   
   For i7 = 1 To empty_cell
      For j8 = 1 To knum
       x2 = Int(Right(d(j8), 1))
    If can(i7, 3) = x2 Then GoTo conti7
      Next j8
    If can(i7, 2) = x1 Then
     ikumi = can(i7, 5)
            For j3 = 1 To ikumi
              If nb = can(i7, 5 + j3) Then
                 For k1 = j3 To ikumi
                 can(i7, 5 + k1) = can(i7, 6 + k1)
                Next k1
                can(i7, 5) = ikumi - 1
                can(i7, 5 + ikumi) = ""
                Exit For
              End If
            Next j3
      End If
conti7:
   Next i7
End If
Next i6

0 件のコメント:

コメントを投稿