Vorige Pagina About the Author

' Completes Order 10 Inlaid Magic Squares
' Order 3 Simple Magic Square Inlays (4 ea)

' Tested with Office 365 under Windows 10

Sub Inlaid103()

Dim a(100), a1(64), b1(100), b(100), c(100)
Dim a0(36), a10(100)

k1 = 1: k2 = 1

y = MsgBox("Blocked", vbCritical, "Inlaid103")
End

For j110 = 1 To 1 

' Refresh Range

Erase b1
For i1 = 1 To 100
    b1(i1) = i1
Next i1
s1 = 505

' Read Set of Order 3 Simple Mgc Sub Squares

Erase a

a(1) = 36:  a(2) = 28:  a(3) = 47:  a(4) = 66:  a(5) = 78:  a(6) = 57:
a(11) = 48: a(12) = 37: a(13) = 26: a(14) = 58: a(15) = 67: a(16) = 76:
a(21) = 27: a(22) = 46: a(23) = 38: a(24) = 77: a(25) = 56: a(26) = 68:
a(31) = 35: a(32) = 23: a(33) = 44: a(34) = 65: a(35) = 73: a(36) = 54:
a(41) = 43: a(42) = 34: a(43) = 25: a(44) = 53: a(45) = 64: a(46) = 75:
a(51) = 24: a(52) = 45: a(53) = 33: a(54) = 74: a(55) = 55: a(56) = 63:

s21 = s1 - a(1) - a(12) - a(23) - a(34) - a(45) - a(56)
s22 = s1 - a(6) - a(15) - a(24) - a(33) - a(42) - a(51)

' Define Available Integers

For i1 = 1 To 100
    If a(i1) <> 0 Then b1(a(i1)) = 0
Next i1

i2 = 0
For i1 = 1 To 100
    If b1(i1) = i1 Then
       i2 = i2 + 1:  a1(i2) = i1
    End If
Next i1
m1 = 1: m2 = i2

'   Upper Part

    For j7 = m1 To m2                                        'a(7)
    If b(a1(j7)) = 0 Then b(a1(j7)) = a1(j7): c(7) = a1(j7) Else GoTo 70
    a(7) = a1(j7)
    
    For j8 = m1 To m2                                        'a(8)
    If b(a1(j8)) = 0 Then b(a1(j8)) = a1(j8): c(8) = a1(j8) Else GoTo 80
    a(8) = a1(j8)
    
    For j9 = m1 To m2                                        'a(9)
    If b(a1(j9)) = 0 Then b(a1(j9)) = a1(j9): c(9) = a1(j9) Else GoTo 90
    a(9) = a1(j9)
    
    a(10) = s1 - a(1) - a(2) - a(3) - a(4) - a(5) - a(6) - a(7) - a(8) - a(9)
    If a(10) < a1(m1) Or a(10) > a1(m2) Then GoTo 100
    If b1(a(10)) = 0 Then GoTo 100
    If b(a(10)) = 0 Then b(a(10)) = a(10): c(10) = a(10) Else GoTo 100

    For j17 = m2 To m1 Step -1                                          'a(17)
    If b(a1(j17)) = 0 Then b(a1(j17)) = a1(j17): c(17) = a1(j17) Else GoTo 170
    a(17) = a1(j17)
    
    For j18 = m2 To m1 Step -1                                          'a(18)
    If b(a1(j18)) = 0 Then b(a1(j18)) = a1(j18): c(18) = a1(j18) Else GoTo 180
    a(18) = a1(j18)
    
    For j19 = m2 To m1 Step -1                                          'a(19)
    If b(a1(j19)) = 0 Then b(a1(j19)) = a1(j19): c(19) = a1(j19) Else GoTo 190
    a(19) = a1(j19)
    
    a(20) = s1 - a(11) - a(12) - a(13) - a(14) - a(15) - a(16) - a(17) - a(18) - a(19)
    If a(20) < a1(m1) Or a(20) > a1(m2) Then GoTo 200
    If b1(a(20)) = 0 Then GoTo 200
    If b(a(20)) = 0 Then b(a(20)) = a(20): c(20) = a(20) Else GoTo 200

'   Lower Part

    For j61 = m1 To m2                                          'a(61)
    If b(a1(j61)) = 0 Then b(a1(j61)) = a1(j61): c(61) = a1(j61) Else GoTo 610
    a(61) = a1(j61)
    
    For j71 = m1 To m2                                          'a(71)
    If b(a1(j71)) = 0 Then b(a1(j71)) = a1(j71): c(71) = a1(j71) Else GoTo 710
    a(71) = a1(j71)
    
    For j81 = m1 To m2                                          'a(81)
    If b(a1(j81)) = 0 Then b(a1(j81)) = a1(j81): c(81) = a1(j81) Else GoTo 810
    a(81) = a1(j81)
    
    a(91) = s1 - a(1) - a(11) - a(21) - a(31) - a(41) - a(51) - a(61) - a(71) - a(81)
    If a(91) < a1(m1) Or a(91) > a1(m2) Then GoTo 910
    If b1(a(91)) = 0 Then GoTo 910
    If b(a(91)) = 0 Then b(a(91)) = a(91): c(91) = a(91) Else GoTo 910

    For j62 = m2 To m1 Step -1                                          'a(62)
    If b(a1(j62)) = 0 Then b(a1(j62)) = a1(j62): c(62) = a1(j62) Else GoTo 620
    a(62) = a1(j62)
    
    For j72 = m2 To m1 Step -1                                          'a(72)
    If b(a1(j72)) = 0 Then b(a1(j72)) = a1(j72): c(72) = a1(j72) Else GoTo 720
    a(72) = a1(j72)
    
    For j82 = m2 To m1 Step -1                                          'a(82)
    If b(a1(j82)) = 0 Then b(a1(j82)) = a1(j82): c(82) = a1(j82) Else GoTo 820
    a(82) = a1(j82)

    a(92) = s1 - a(2) - a(12) - a(22) - a(32) - a(42) - a(52) - a(62) - a(72) - a(82)
    If a(92) < a1(m1) Or a(92) > a1(m2) Then GoTo 920
    If b1(a(92)) = 0 Then GoTo 920
    If b(a(92)) = 0 Then b(a(92)) = a(92): c(92) = a(92) Else GoTo 920

    For j63 = m1 To m2                                          'a(63)
    If b(a1(j63)) = 0 Then b(a1(j63)) = a1(j63): c(63) = a1(j63) Else GoTo 630
    a(63) = a1(j63)
    
    For j73 = m1 To m2                                          'a(73)
    If b(a1(j73)) = 0 Then b(a1(j73)) = a1(j73): c(73) = a1(j73) Else GoTo 730
    a(73) = a1(j73)
    
    For j83 = m1 To m2                                          'a(83)
    If b(a1(j83)) = 0 Then b(a1(j83)) = a1(j83): c(83) = a1(j83) Else GoTo 830
    a(83) = a1(j83)
    
    a(93) = s1 - a(3) - a(13) - a(23) - a(33) - a(43) - a(53) - a(63) - a(73) - a(83)
    If a(93) < a1(m1) Or a(93) > a1(m2) Then GoTo 930
    If b1(a(93)) = 0 Then GoTo 930
    If b(a(93)) = 0 Then b(a(93)) = a(93): c(93) = a(93) Else GoTo 930

    For j64 = m2 To m1 Step -1                                          'a(64)
    If b(a1(j64)) = 0 Then b(a1(j64)) = a1(j64): c(64) = a1(j64) Else GoTo 640
    a(64) = a1(j64)
    
    For j74 = m2 To m1 Step -1                                          'a(74)
    If b(a1(j74)) = 0 Then b(a1(j74)) = a1(j74): c(74) = a1(j74) Else GoTo 740
    a(74) = a1(j74)
    
    For j84 = m2 To m1 Step -1                                          'a(84)
    If b(a1(j84)) = 0 Then b(a1(j84)) = a1(j84): c(84) = a1(j84) Else GoTo 840
    a(84) = a1(j84)
    
    a(94) = s1 - a(4) - a(14) - a(24) - a(34) - a(44) - a(54) - a(64) - a(74) - a(84)
    If a(94) < a1(m1) Or a(94) > a1(m2) Then GoTo 940
    If b1(a(94)) = 0 Then GoTo 940
    If b(a(94)) = 0 Then b(a(94)) = a(94): c(94) = a(94) Else GoTo 940

    For j65 = m1 To m2                                          'a(65)
    If b(a1(j65)) = 0 Then b(a1(j65)) = a1(j65): c(65) = a1(j65) Else GoTo 650
    a(65) = a1(j65)
    
    For j75 = m1 To m2                                          'a(75)
    If b(a1(j75)) = 0 Then b(a1(j75)) = a1(j75): c(75) = a1(j75) Else GoTo 750
    a(75) = a1(j75)
    
    For j85 = m1 To m2                                          'a(85)
    If b(a1(j85)) = 0 Then b(a1(j85)) = a1(j85): c(85) = a1(j85) Else GoTo 850
    a(85) = a1(j85)
    
    a(95) = s1 - a(5) - a(15) - a(25) - a(35) - a(45) - a(55) - a(65) - a(75) - a(85)
    If a(95) < a1(m1) Or a(95) > a1(m2) Then GoTo 950
    If b1(a(95)) = 0 Then GoTo 950
    If b(a(95)) = 0 Then b(a(95)) = a(95): c(95) = a(95) Else GoTo 950
    
    For j66 = m2 To m1 Step -1                                          'a(66)
    If b(a1(j66)) = 0 Then b(a1(j66)) = a1(j66): c(66) = a1(j66) Else GoTo 660
    a(66) = a1(j66)
    
    For j76 = m2 To m1 Step -1                                          'a(76)
    If b(a1(j76)) = 0 Then b(a1(j76)) = a1(j76): c(76) = a1(j76) Else GoTo 760
    a(76) = a1(j76)
    
    For j86 = m2 To m1 Step -1                                          'a(86)
    If b(a1(j86)) = 0 Then b(a1(j86)) = a1(j86): c(86) = a1(j86) Else GoTo 860
    a(86) = a1(j86)
    
    a(96) = s1 - a(6) - a(16) - a(26) - a(36) - a(46) - a(56) - a(66) - a(76) - a(86)
    If a(96) < a1(m1) Or a(96) > a1(m2) Then GoTo 960
    If b1(a(96)) = 0 Then GoTo 960
    If b(a(96)) = 0 Then b(a(96)) = a(96): c(96) = a(96) Else GoTo 960

    For j100 = m1 To m2                                          'a(100)
    If b(a1(j100)) = 0 Then b(a1(j100)) = a1(j100): c(100) = a1(j100) Else GoTo 1000
    a(100) = a1(j100)

    For j89 = m1 To m2                                          'a(89)
    If b(a1(j89)) = 0 Then b(a1(j89)) = a1(j89): c(89) = a1(j89) Else GoTo 890
    a(89) = a1(j89)
   
    For j78 = m1 To m2                                          'a(78)
    If b(a1(j78)) = 0 Then b(a1(j78)) = a1(j78): c(78) = a1(j78) Else GoTo 780
    a(78) = a1(j78)

    a(67) = s21 - a(100) - a(89) - a(78)
    If a(67) < a1(m1) Or a(67) > a1(m2) Then GoTo 670
    If b1(a(67)) = 0 Then GoTo 670
    If b(a(67)) = 0 Then b(a(67)) = a(67): c(67) = a(67) Else GoTo 670

    For j97 = m1 To m2                                          'a(97)
    If b(a1(j97)) = 0 Then b(a1(j97)) = a1(j97): c(97) = a1(j97) Else GoTo 970
    a(97) = a1(j97)

    For j88 = m1 To m2                                          'a(88)
    If b(a1(j88)) = 0 Then b(a1(j88)) = a1(j88): c(88) = a1(j88) Else GoTo 880
    a(88) = a1(j88)
    
    For j79 = m1 To m2                                          'a(79)
    If b(a1(j79)) = 0 Then b(a1(j79)) = a1(j79): c(79) = a1(j79) Else GoTo 790
    a(79) = a1(j79)

    a(70) = s22 - a(79) - a(88) - a(97)
    If a(70) < a1(m1) Or a(70) > a1(m2) Then GoTo 700
    If b1(a(70)) = 0 Then GoTo 700
    If b(a(70)) = 0 Then b(a(70)) = a(70): c(70) = a(70) Else GoTo 700

    For j99 = m1 To m2                                          'a(99)
    If b(a1(j99)) = 0 Then b(a1(j99)) = a1(j99): c(99) = a1(j99) Else GoTo 990
    a(99) = a1(j99)

    a(98) = s1 - a(91) - a(92) - a(93) - a(94) - a(95) - a(96) - a(97) - a(99) - a(100)
    If a(98) < a1(m1) Or a(98) > a1(m2) Then GoTo 980
    If b1(a(98)) = 0 Then GoTo 980
    If b(a(98)) = 0 Then b(a(98)) = a(98): c(98) = a(98) Else GoTo 980

    For j90 = m1 To m2                                          'a(90)
    If b(a1(j90)) = 0 Then b(a1(j90)) = a1(j90): c(90) = a1(j90) Else GoTo 900
    a(90) = a1(j90)

    a(87) = s1 - a(81) - a(82) - a(83) - a(84) - a(85) - a(86) - a(88) - a(89) - a(90)
    If a(87) < a1(m1) Or a(87) > a1(m2) Then GoTo 870
    If b1(a(87)) = 0 Then GoTo 870
    If b(a(87)) = 0 Then b(a(87)) = a(87): c(87) = a(87) Else GoTo 870
  
    For j80 = m1 To m2                                          'a(80)
    If b(a1(j80)) = 0 Then b(a1(j80)) = a1(j80): c(80) = a1(j80) Else GoTo 800
    a(80) = a1(j80)

    a(77) = s1 - a(71) - a(72) - a(73) - a(74) - a(75) - a(76) - a(78) - a(79) - a(80)
    If a(77) < a1(m1) Or a(77) > a1(m2) Then GoTo 770
    If b1(a(77)) = 0 Then GoTo 770
    If b(a(77)) = 0 Then b(a(77)) = a(77): c(77) = a(77) Else GoTo 770

    For j27 = m1 To m2                                          'a(27)
    If b(a1(j27)) = 0 Then b(a1(j27)) = a1(j27): c(27) = a1(j27) Else GoTo 270
    a(27) = a1(j27)
   
    For j28 = m1 To m2                                          'a(28)
    If b(a1(j28)) = 0 Then b(a1(j28)) = a1(j28): c(28) = a1(j28) Else GoTo 280
    a(28) = a1(j28)
    
    For j29 = m1 To m2                                          'a(29)
    If b(a1(j29)) = 0 Then b(a1(j29)) = a1(j29): c(29) = a1(j29) Else GoTo 290
    a(29) = a1(j29)
    
    a(30) = s1 - a(21) - a(22) - a(23) - a(24) - a(25) - a(26) - a(27) - a(28) - a(29)
    If a(30) < a1(m1) Or a(30) > a1(m2) Then GoTo 300
    If b1(a(30)) = 0 Then GoTo 300
    If b(a(30)) = 0 Then b(a(30)) = a(30): c(30) = a(30) Else GoTo 300

    For j37 = m2 To m1 Step -1                                          'a(37)
    If b(a1(j37)) = 0 Then b(a1(j37)) = a1(j37): c(37) = a1(j37) Else GoTo 370
    a(37) = a1(j37)
    
    For j38 = m2 To m1 Step -1                                          'a(38)
    If b(a1(j38)) = 0 Then b(a1(j38)) = a1(j38): c(38) = a1(j38) Else GoTo 380
    a(38) = a1(j38)
    
    For j39 = m2 To m1 Step -1                                          'a(39)
    If b(a1(j39)) = 0 Then b(a1(j39)) = a1(j39): c(39) = a1(j39) Else GoTo 390
    a(39) = a1(j39)
    
    a(40) = s1 - a(31) - a(32) - a(33) - a(34) - a(35) - a(36) - a(37) - a(38) - a(39)
    If a(40) < a1(m1) Or a(40) > a1(m2) Then GoTo 400
    If b1(a(40)) = 0 Then GoTo 400
    If b(a(40)) = 0 Then b(a(40)) = a(40): c(40) = a(40) Else GoTo 400

    For j47 = m1 To m2                                          'a(47)
    If b(a1(j47)) = 0 Then b(a1(j47)) = a1(j47): c(47) = a1(j47) Else GoTo 470
    a(47) = a1(j47)
    
    For j48 = m1 To m2                                          'a(48)
    If b(a1(j48)) = 0 Then b(a1(j48)) = a1(j48): c(48) = a1(j48) Else GoTo 480
    a(48) = a1(j48)
    
    For j49 = m1 To m2                                          'a(49)
    If b(a1(j49)) = 0 Then b(a1(j49)) = a1(j49): c(49) = a1(j49) Else GoTo 490
    a(49) = a1(j49)
    
    a(50) = s1 - a(41) - a(42) - a(43) - a(44) - a(45) - a(46) - a(47) - a(48) - a(49)
    If a(50) < a1(m1) Or a(50) > a1(m2) Then GoTo 500
    If b1(a(50)) = 0 Then GoTo 500
    If b(a(50)) = 0 Then b(a(50)) = a(50): c(50) = a(50) Else GoTo 500

    a(60) = s1 - a(10) - a(20) - a(30) - a(40) - a(50) - a(70) - a(80) - a(90) - a(100)
    If a(60) < a1(m1) Or a(60) > a1(m2) Then GoTo 600
    If b1(a(60)) = 0 Then GoTo 600
    If b(a(60)) = 0 Then b(a(60)) = a(60): c(60) = a(60) Else GoTo 600

    a(57) = s1 - a(7) - a(17) - a(27) - a(37) - a(47) - a(67) - a(77) - a(87) - a(97)
    If a(57) < a1(m1) Or a(57) > a1(m2) Then GoTo 570
    If b1(a(57)) = 0 Then GoTo 570
    If b(a(57)) = 0 Then b(a(57)) = a(57): c(57) = a(57) Else GoTo 570

    For j69 = m1 To m2                                          'a(69)
    If b(a1(j69)) = 0 Then b(a1(j69)) = a1(j69): c(69) = a1(j69) Else GoTo 690
    a(69) = a1(j69)

    a(68) = s1 - a(61) - a(62) - a(63) - a(64) - a(65) - a(66) - a(67) - a(69) - a(70)
    If a(68) < a1(m1) Or a(68) > a1(m2) Then GoTo 680
    If b1(a(68)) = 0 Then GoTo 680
    If b(a(68)) = 0 Then b(a(68)) = a(68): c(68) = a(68) Else GoTo 680

    a(59) = s1 - a(9) - a(19) - a(29) - a(39) - a(49) - a(69) - a(79) - a(89) - a(99)
    If a(59) < a1(m1) Or a(59) > a1(m2) Then GoTo 590
    If b1(a(59)) = 0 Then GoTo 590
    If b(a(59)) = 0 Then b(a(59)) = a(59): c(59) = a(59) Else GoTo 590

    a(58) = s1 - a(8) - a(18) - a(28) - a(38) - a(48) - a(68) - a(78) - a(88) - a(98)
    If a(58) < a1(m1) Or a(58) > a1(m2) Then GoTo 580
    If b1(a(58)) = 0 Then GoTo 580
    If b(a(58)) = 0 Then b(a(58)) = a(58): c(58) = a(58) Else GoTo 580


'             n9 = n9 + 1: GoSub 1650        'Print Semi   Magic Square
              n9 = n9 + 1: GoSub 1750        'Print Simple Magic Square (Window   Format)
'             n9 = n9 + 1: GoSub 1650        'Print Simple Magic Square (Bordered Format)
              Erase b, c:  GoTo  1100        'Print only first square


    b(c(58)) = 0: c(58) = 0
580 b(c(59)) = 0: c(59) = 0
590 b(c(68)) = 0: c(68) = 0
680 b(c(69)) = 0: c(69) = 0
690 Next j69

    b(c(57)) = 0: c(57) = 0
570 b(c(60)) = 0: c(60) = 0
600 b(c(50)) = 0: c(50) = 0
500 b(c(49)) = 0: c(49) = 0
490 Next j49

    b(c(48)) = 0: c(48) = 0
480 Next j48

    b(c(47)) = 0: c(47) = 0
470 Next j47

    b(c(40)) = 0: c(40) = 0
400 b(c(39)) = 0: c(39) = 0
390 Next j39

    b(c(38)) = 0: c(38) = 0
380 Next j38

    b(c(37)) = 0: c(37) = 0
370 Next j37

    b(c(30)) = 0: c(30) = 0
300 b(c(29)) = 0: c(29) = 0
290 Next j29

    b(c(28)) = 0: c(28) = 0
280 Next j28

    b(c(27)) = 0: c(27) = 0
270 Next j27

    b(c(77)) = 0: c(77) = 0
770 b(c(80)) = 0: c(80) = 0
800 Next j80

    b(c(87)) = 0: c(87) = 0
870 b(c(90)) = 0: c(90) = 0
900 Next j90
    
    b(c(98)) = 0: c(98) = 0
980 b(c(99)) = 0: c(99) = 0
990 Next j99
    
    b(c(70)) = 0: c(70) = 0
700 b(c(79)) = 0: c(79) = 0
790 Next j79

    b(c(88)) = 0: c(88) = 0
880 Next j88
 
    b(c(97)) = 0: c(97) = 0
970 Next j97

    b(c(67)) = 0: c(67) = 0
670 b(c(78)) = 0: c(78) = 0
780 Next j78

     b(c(89)) = 0: c(89) = 0
890  Next j89

     b(c(100)) = 0: c(100) = 0
1000 Next j100

965
    b(c(96)) = 0: c(96) = 0
960 b(c(86)) = 0: c(86) = 0
860 Next j86

    b(c(76)) = 0: c(76) = 0
760 Next j76

    b(c(66)) = 0: c(66) = 0
660 Next j66

    b(c(95)) = 0: c(95) = 0
950 b(c(85)) = 0: c(85) = 0
850 Next j85

    b(c(75)) = 0: c(75) = 0
750 Next j75

    b(c(65)) = 0: c(65) = 0
650 Next j65

    b(c(94)) = 0: c(94) = 0
940 b(c(84)) = 0: c(84) = 0
840 Next j84

    b(c(74)) = 0: c(74) = 0
740 Next j74

    b(c(64)) = 0: c(64) = 0
640 Next j64

    b(c(93)) = 0: c(93) = 0
930 b(c(83)) = 0: c(83) = 0
830 Next j83

    b(c(73)) = 0: c(73) = 0
730 Next j73

    b(c(63)) = 0: c(63) = 0
630 Next j63

    b(c(92)) = 0: c(92) = 0
920 b(c(82)) = 0: c(82) = 0
820 Next j82

    b(c(72)) = 0: c(72) = 0
720 Next j72

    b(c(62)) = 0: c(62) = 0
620 Next j62

    b(c(91)) = 0: c(91) = 0
910 b(c(81)) = 0: c(81) = 0
810 Next j81

    b(c(71)) = 0: c(71) = 0
710 Next j71

    b(c(61)) = 0: c(61) = 0
610 Next j61

    b(c(20)) = 0: c(20) = 0
200 b(c(19)) = 0: c(19) = 0
190 Next j19

    b(c(18)) = 0: c(18) = 0
180 Next j18

    b(c(17)) = 0: c(17) = 0
170 Next j17

    b(c(10)) = 0: c(10) = 0
100 b(c(9)) = 0: c(9) = 0
90 Next j9

    b(c(8)) = 0: c(8) = 0
80 Next j8

    b(c(7)) = 0: c(7) = 0
70 Next j7

1100 Next j110

y = MsgBox("Search Completed", vbExclamation, "Inlaid103")

End

'    Print Results (Semi Magic Squares)

1650 n2 = n2 + 1
     If n2 = 4 Then
         n2 = 1: k1 = k1 + 11: k2 = 1
     Else
         If n9 > 1 Then k2 = k2 + 11
     End If

     Cells(k1, k2 + 1).Font.Color = -4165632
     Cells(k1, k2 + 1).Value = s1
     Cells(k1, k2 + 2).Value = j110
    
     i3 = 0
     For i1 = 1 To 10
         For i2 = 1 To 10
             i3 = i3 + 1
             Cells(k1 + i1, k2 + i2).Value = a(i3)
         Next i2
     Next i1

     Return

'    Print Results (Simple Magic Squares, Window Format)

1750 'Transform to Window Format

     a10(1) = a(67):  a10(2) = a(68):  a10(3) = a(61):  a10(4) = a(62):  a10(5) = a(63):
     a10(6) = a(64):  a10(7) = a(65):  a10(8) = a(66):  a10(9) = a(69):  a10(10) = a(70):
     a10(11) = a(77): a10(12) = a(78): a10(13) = a(71): a10(14) = a(72): a10(15) = a(73):
     a10(16) = a(74): a10(17) = a(75): a10(18) = a(76): a10(19) = a(79): a10(20) = a(80):
     a10(21) = a(7):  a10(22) = a(8):  a10(23) = a(1):  a10(24) = a(2):  a10(25) = a(3):
     a10(26) = a(4):  a10(27) = a(5):  a10(28) = a(6):  a10(29) = a(9):  a10(30) = a(10):
     a10(31) = a(17): a10(32) = a(18): a10(33) = a(11): a10(34) = a(12): a10(35) = a(13):
     a10(36) = a(14): a10(37) = a(15): a10(38) = a(16): a10(39) = a(19): a10(40) = a(20):
     a10(41) = a(27): a10(42) = a(28): a10(43) = a(21): a10(44) = a(22): a10(45) = a(23):
     a10(46) = a(24): a10(47) = a(25): a10(48) = a(26): a10(49) = a(29): a10(50) = a(30):
     a10(51) = a(37): a10(52) = a(38): a10(53) = a(31): a10(54) = a(32): a10(55) = a(33):
     a10(56) = a(34): a10(57) = a(35): a10(58) = a(36): a10(59) = a(39): a10(60) = a(40):
     a10(61) = a(47): a10(62) = a(48): a10(63) = a(41): a10(64) = a(42): a10(65) = a(43):
     a10(66) = a(44): a10(67) = a(45): a10(68) = a(46): a10(69) = a(49): a10(70) = a(50):
     a10(71) = a(57): a10(72) = a(58): a10(73) = a(51): a10(74) = a(52): a10(75) = a(53):
     a10(76) = a(54): a10(77) = a(55): a10(78) = a(56): a10(79) = a(59): a10(80) = a(60):
     a10(81) = a(87): a10(82) = a(88): a10(83) = a(81): a10(84) = a(82): a10(85) = a(83):
     a10(86) = a(84): a10(87) = a(85): a10(88) = a(86): a10(89) = a(89): a10(90) = a(90):
     a10(91) = a(97): a10(92) = a(98): a10(93) = a(91): a10(94) = a(92): a10(95) = a(93):
     a10(96) = a(94): a10(97) = a(95): a10(98) = a(96): a10(99) = a(99): a10(100) = a(100):

     Gosub 1950	'  Print a10()

     Return	

'    Print Results (Simple Magic Squares, Bordered Format)

1850 'Transform to Border Format

     a10(1) = a(78):   a10(2) = a(71):  a10(3) = a(72):  a10(4) = a(73):  a10(5) = a(77):
     a10(6) = a(80):   a10(7) = a(74):  a10(8) = a(75):  a10(9) = a(76):  a10(10) = a(79):
     a10(11) = a(8):   a10(12) = a(1):  a10(13) = a(2):  a10(14) = a(3):  a10(15) = a(7):
     a10(16) = a(10):  a10(17) = a(4):  a10(18) = a(5):  a10(19) = a(6):  a10(20) = a(9):
     a10(21) = a(18):  a10(22) = a(11): a10(23) = a(12): a10(24) = a(13): a10(25) = a(17):
     a10(26) = a(20):  a10(27) = a(14): a10(28) = a(15): a10(29) = a(16): a10(30) = a(19):
     a10(31) = a(28):  a10(32) = a(21): a10(33) = a(22): a10(34) = a(23): a10(35) = a(27):
     a10(36) = a(30):  a10(37) = a(24): a10(38) = a(25): a10(39) = a(26): a10(40) = a(29):
     a10(41) = a(68):  a10(42) = a(61): a10(43) = a(62): a10(44) = a(63): a10(45) = a(67):
     a10(46) = a(70):  a10(47) = a(64): a10(48) = a(65): a10(49) = a(66): a10(50) = a(69):
     a10(51) = a(98):  a10(52) = a(91): a10(53) = a(92): a10(54) = a(93): a10(55) = a(97):
     a10(56) = a(100): a10(57) = a(94): a10(58) = a(95): a10(59) = a(96): a10(60) = a(99):
     a10(61) = a(38):  a10(62) = a(31): a10(63) = a(32): a10(64) = a(33): a10(65) = a(37):
     a10(66) = a(40):  a10(67) = a(34): a10(68) = a(35): a10(69) = a(36): a10(70) = a(39):
     a10(71) = a(48):  a10(72) = a(41): a10(73) = a(42): a10(74) = a(43): a10(75) = a(47):
     a10(76) = a(50):  a10(77) = a(44): a10(78) = a(45): a10(79) = a(46): a10(80) = a(49):
     a10(81) = a(58):  a10(82) = a(51): a10(83) = a(52): a10(84) = a(53): a10(85) = a(57):
     a10(86) = a(60):  a10(87) = a(54): a10(88) = a(55): a10(89) = a(56): a10(90) = a(59):
     a10(91) = a(88):  a10(92) = a(81): a10(93) = a(82): a10(94) = a(83): a10(95) = a(87):
     a10(96) = a(90):  a10(97) = a(84): a10(98) = a(85): a10(99) = a(86): a10(100) = a(89):

'    Print a10()

1950 n2 = n2 + 1
     If n2 = 4 Then
         n2 = 1: k1 = k1 + 11: k2 = 1
     Else
         If n9 > 1 Then k2 = k2 + 11
     End If

     Cells(k1, k2 + 1).Font.Color = -4165632
     Cells(k1, k2 + 1).Value = s1
     Cells(k1, k2 + 2).Value = j110
    
     i3 = 0
     For i1 = 1 To 10
         For i2 = 1 To 10
             i3 = i3 + 1
             Cells(k1 + i1, k2 + i2).Value = a10(i3)
         Next i2
     Next i1

     Return	

End Sub


Vorige Pagina About the Author