Bonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
Bonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
Bonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
Bonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
Bonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
Bonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
...
je vois donc une variante:
2 segments verticaux à une distance chacun de un tiers de côté du carré.
2 horizontaux idem , et nous voilà bien neuf carrés cette fois ci égaux
Sauf que...
sauriez vous en obtenir neuf... ,et bien cela fera dix avec celui du pourtour
+4 si l'on considère les 4 groues de 4 carrés situés à l'intérieur,
soit 14 carrés en tout.
@+
lStephBonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
...
je vois donc une variante:
2 segments verticaux à une distance chacun de un tiers de côté du carré.
2 horizontaux idem , et nous voilà bien neuf carrés cette fois ci égaux
Sauf que...
sauriez vous en obtenir neuf... ,et bien cela fera dix avec celui du pourtour
+4 si l'on considère les 4 groues de 4 carrés situés à l'intérieur,
soit 14 carrés en tout.
@+
lSteph
Bonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
...
je vois donc une variante:
2 segments verticaux à une distance chacun de un tiers de côté du carré.
2 horizontaux idem , et nous voilà bien neuf carrés cette fois ci égaux
Sauf que...
sauriez vous en obtenir neuf... ,et bien cela fera dix avec celui du pourtour
+4 si l'on considère les 4 groues de 4 carrés situés à l'intérieur,
soit 14 carrés en tout.
@+
lStephBonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
Il faudrait modifier un tantinet les questions :
1.
À partir d'un seul carré sauriez-vous en obtenir
exactement neuf en traçant quatre segments
de droite à l'intérieur du carré initial.
2.
À partir d'un seul carré sauriez-vous en obtenir
exactement quatorze en traçant quatre segments
de droite à l'intérieur du carré initial.
Et je me demande quelle est la question la plus difficile ;-)
A+
Serge
"LSteph" a écrit dans le message de news:...
je vois donc une variante:
2 segments verticaux à une distance chacun de un tiers de côté du carré.
2 horizontaux idem , et nous voilà bien neuf carrés cette fois ci égaux
Sauf que...
sauriez vous en obtenir neuf... ,et bien cela fera dix avec celui du pourtour
+4 si l'on considère les 4 groues de 4 carrés situés à l'intérieur,
soit 14 carrés en tout.
@+
lStephBonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
Il faudrait modifier un tantinet les questions :
1.
À partir d'un seul carré sauriez-vous en obtenir
exactement neuf en traçant quatre segments
de droite à l'intérieur du carré initial.
2.
À partir d'un seul carré sauriez-vous en obtenir
exactement quatorze en traçant quatre segments
de droite à l'intérieur du carré initial.
Et je me demande quelle est la question la plus difficile ;-)
A+
Serge
"LSteph" <lecocosteph@frite.fr> a écrit dans le message de news: OOU8QhbkHHA.1388@TK2MSFTNGP05.phx.gbl...
...
je vois donc une variante:
2 segments verticaux à une distance chacun de un tiers de côté du carré.
2 horizontaux idem , et nous voilà bien neuf carrés cette fois ci égaux
Sauf que...
sauriez vous en obtenir neuf... ,et bien cela fera dix avec celui du pourtour
+4 si l'on considère les 4 groues de 4 carrés situés à l'intérieur,
soit 14 carrés en tout.
@+
lSteph
Bonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
Il faudrait modifier un tantinet les questions :
1.
À partir d'un seul carré sauriez-vous en obtenir
exactement neuf en traçant quatre segments
de droite à l'intérieur du carré initial.
2.
À partir d'un seul carré sauriez-vous en obtenir
exactement quatorze en traçant quatre segments
de droite à l'intérieur du carré initial.
Et je me demande quelle est la question la plus difficile ;-)
A+
Serge
"LSteph" a écrit dans le message de news:...
je vois donc une variante:
2 segments verticaux à une distance chacun de un tiers de côté du carré.
2 horizontaux idem , et nous voilà bien neuf carrés cette fois ci égaux
Sauf que...
sauriez vous en obtenir neuf... ,et bien cela fera dix avec celui du pourtour
+4 si l'on considère les 4 groues de 4 carrés situés à l'intérieur,
soit 14 carrés en tout.
@+
lStephBonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
Il faudrait modifier un tantinet les questions :
1.
À partir d'un seul carré sauriez-vous en obtenir
exactement neuf en traçant quatre segments
de droite à l'intérieur du carré initial.
2.
À partir d'un seul carré sauriez-vous en obtenir
exactement quatorze en traçant quatre segments
de droite à l'intérieur du carré initial.
Et je me demande quelle est la question la plus difficile ;-)
A+
Serge
"LSteph" a écrit dans le message de news:...
je vois donc une variante:
2 segments verticaux à une distance chacun de un tiers de côté du carré.
2 horizontaux idem , et nous voilà bien neuf carrés cette fois ci égaux
Sauf que...
sauriez vous en obtenir neuf... ,et bien cela fera dix avec celui du pourtour
+4 si l'on considère les 4 groues de 4 carrés situés à l'intérieur,
soit 14 carrés en tout.
@+
lStephBonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
Il faudrait modifier un tantinet les questions :
1.
À partir d'un seul carré sauriez-vous en obtenir
exactement neuf en traçant quatre segments
de droite à l'intérieur du carré initial.
2.
À partir d'un seul carré sauriez-vous en obtenir
exactement quatorze en traçant quatre segments
de droite à l'intérieur du carré initial.
Et je me demande quelle est la question la plus difficile ;-)
A+
Serge
"LSteph" <lecocosteph@frite.fr> a écrit dans le message de news: OOU8QhbkHHA.1388@TK2MSFTNGP05.phx.gbl...
...
je vois donc une variante:
2 segments verticaux à une distance chacun de un tiers de côté du carré.
2 horizontaux idem , et nous voilà bien neuf carrés cette fois ci égaux
Sauf que...
sauriez vous en obtenir neuf... ,et bien cela fera dix avec celui du pourtour
+4 si l'on considère les 4 groues de 4 carrés situés à l'intérieur,
soit 14 carrés en tout.
@+
lSteph
Bonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
Il faudrait modifier un tantinet les questions :
1.
À partir d'un seul carré sauriez-vous en obtenir
exactement neuf en traçant quatre segments
de droite à l'intérieur du carré initial.
2.
À partir d'un seul carré sauriez-vous en obtenir
exactement quatorze en traçant quatre segments
de droite à l'intérieur du carré initial.
Et je me demande quelle est la question la plus difficile ;-)
A+
Serge
"LSteph" a écrit dans le message de news:...
je vois donc une variante:
2 segments verticaux à une distance chacun de un tiers de côté du carré.
2 horizontaux idem , et nous voilà bien neuf carrés cette fois ci égaux
Sauf que...
sauriez vous en obtenir neuf... ,et bien cela fera dix avec celui du pourtour
+4 si l'on considère les 4 groues de 4 carrés situés à l'intérieur,
soit 14 carrés en tout.
@+
lStephBonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
...ce qui peut être assez surprenant ou amusant c'est les réponses parfois obtenues lorsqu'on demande
combien voyez vous de carrés ?
@+
StephaneIl faudrait modifier un tantinet les questions :
1.
À partir d'un seul carré sauriez-vous en obtenir
exactement neuf en traçant quatre segments
de droite à l'intérieur du carré initial.
2.
À partir d'un seul carré sauriez-vous en obtenir
exactement quatorze en traçant quatre segments
de droite à l'intérieur du carré initial.
Et je me demande quelle est la question la plus difficile ;-)
A+
Serge
"LSteph" a écrit dans le message de news:...
je vois donc une variante:
2 segments verticaux à une distance chacun de un tiers de côté du carré.
2 horizontaux idem , et nous voilà bien neuf carrés cette fois ci égaux
Sauf que...
sauriez vous en obtenir neuf... ,et bien cela fera dix avec celui du pourtour
+4 si l'on considère les 4 groues de 4 carrés situés à l'intérieur,
soit 14 carrés en tout.
@+
lStephBonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
...ce qui peut être assez surprenant ou amusant c'est les réponses parfois obtenues lorsqu'on demande
combien voyez vous de carrés ?
@+
Stephane
Il faudrait modifier un tantinet les questions :
1.
À partir d'un seul carré sauriez-vous en obtenir
exactement neuf en traçant quatre segments
de droite à l'intérieur du carré initial.
2.
À partir d'un seul carré sauriez-vous en obtenir
exactement quatorze en traçant quatre segments
de droite à l'intérieur du carré initial.
Et je me demande quelle est la question la plus difficile ;-)
A+
Serge
"LSteph" <lecocosteph@frite.fr> a écrit dans le message de news: OOU8QhbkHHA.1388@TK2MSFTNGP05.phx.gbl...
...
je vois donc une variante:
2 segments verticaux à une distance chacun de un tiers de côté du carré.
2 horizontaux idem , et nous voilà bien neuf carrés cette fois ci égaux
Sauf que...
sauriez vous en obtenir neuf... ,et bien cela fera dix avec celui du pourtour
+4 si l'on considère les 4 groues de 4 carrés situés à l'intérieur,
soit 14 carrés en tout.
@+
lSteph
Bonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
...ce qui peut être assez surprenant ou amusant c'est les réponses parfois obtenues lorsqu'on demande
combien voyez vous de carrés ?
@+
StephaneIl faudrait modifier un tantinet les questions :
1.
À partir d'un seul carré sauriez-vous en obtenir
exactement neuf en traçant quatre segments
de droite à l'intérieur du carré initial.
2.
À partir d'un seul carré sauriez-vous en obtenir
exactement quatorze en traçant quatre segments
de droite à l'intérieur du carré initial.
Et je me demande quelle est la question la plus difficile ;-)
A+
Serge
"LSteph" a écrit dans le message de news:...
je vois donc une variante:
2 segments verticaux à une distance chacun de un tiers de côté du carré.
2 horizontaux idem , et nous voilà bien neuf carrés cette fois ci égaux
Sauf que...
sauriez vous en obtenir neuf... ,et bien cela fera dix avec celui du pourtour
+4 si l'on considère les 4 groues de 4 carrés situés à l'intérieur,
soit 14 carrés en tout.
@+
lStephBonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
...ce qui peut être assez surprenant ou amusant c'est les réponses
parfois obtenues lorsqu'on demande
combien voyez vous de carrés ?
@+
StephaneIl faudrait modifier un tantinet les questions :
1.
À partir d'un seul carré sauriez-vous en obtenir
exactement neuf en traçant quatre segments
de droite à l'intérieur du carré initial.
2.
À partir d'un seul carré sauriez-vous en obtenir
exactement quatorze en traçant quatre segments
de droite à l'intérieur du carré initial.
Et je me demande quelle est la question la plus difficile ;-)
A+
Serge
"LSteph" a écrit dans le message de news:...
je vois donc une variante:
2 segments verticaux à une distance chacun de un tiers de côté du carré.
2 horizontaux idem , et nous voilà bien neuf carrés cette fois ci égaux
Sauf que...
sauriez vous en obtenir neuf... ,et bien cela fera dix avec celui du
pourtour
+4 si l'on considère les 4 groues de 4 carrés situés à l'intérieur,
soit 14 carrés en tout.
@+
lStephBonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150,
150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, "
De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc,
hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc +
165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc +
165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc +
255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc +
255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc
/ 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc
/ 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3
* hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3
* hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
...ce qui peut être assez surprenant ou amusant c'est les réponses
parfois obtenues lorsqu'on demande
combien voyez vous de carrés ?
@+
Stephane
Il faudrait modifier un tantinet les questions :
1.
À partir d'un seul carré sauriez-vous en obtenir
exactement neuf en traçant quatre segments
de droite à l'intérieur du carré initial.
2.
À partir d'un seul carré sauriez-vous en obtenir
exactement quatorze en traçant quatre segments
de droite à l'intérieur du carré initial.
Et je me demande quelle est la question la plus difficile ;-)
A+
Serge
"LSteph" <lecocosteph@frite.fr> a écrit dans le message de news:
OOU8QhbkHHA.1388@TK2MSFTNGP05.phx.gbl...
...
je vois donc une variante:
2 segments verticaux à une distance chacun de un tiers de côté du carré.
2 horizontaux idem , et nous voilà bien neuf carrés cette fois ci égaux
Sauf que...
sauriez vous en obtenir neuf... ,et bien cela fera dix avec celui du
pourtour
+4 si l'on considère les 4 groues de 4 carrés situés à l'intérieur,
soit 14 carrés en tout.
@+
lSteph
Bonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150,
150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, "
De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc,
hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc +
165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc +
165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc +
255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc +
255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc
/ 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc
/ 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3
* hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3
* hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
...ce qui peut être assez surprenant ou amusant c'est les réponses
parfois obtenues lorsqu'on demande
combien voyez vous de carrés ?
@+
StephaneIl faudrait modifier un tantinet les questions :
1.
À partir d'un seul carré sauriez-vous en obtenir
exactement neuf en traçant quatre segments
de droite à l'intérieur du carré initial.
2.
À partir d'un seul carré sauriez-vous en obtenir
exactement quatorze en traçant quatre segments
de droite à l'intérieur du carré initial.
Et je me demande quelle est la question la plus difficile ;-)
A+
Serge
"LSteph" a écrit dans le message de news:...
je vois donc une variante:
2 segments verticaux à une distance chacun de un tiers de côté du carré.
2 horizontaux idem , et nous voilà bien neuf carrés cette fois ci égaux
Sauf que...
sauriez vous en obtenir neuf... ,et bien cela fera dix avec celui du
pourtour
+4 si l'on considère les 4 groues de 4 carrés situés à l'intérieur,
soit 14 carrés en tout.
@+
lStephBonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150,
150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, "
De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc,
hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc +
165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc +
165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc +
255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc +
255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc
/ 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc
/ 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3
* hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3
* hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
Salut Stéphane,
En voici une moins bébé lala ;-)))
Placer tous les nombres entiers de 1 à 16 dans
une grille 4x4 de telle sorte que les sommes de
chaque ligne, chaque colonne et chaque diagonale
soient différentes. De plus ces dix sommes doivent
former une suite de nombres consécutifs.
Serais curieux de voir le code VBA qui pourrait
répondre à ça. Je vais très peut-être essayer ;-)
Serge
"LSteph" a écrit dans le message de news:...ce qui peut être assez surprenant ou amusant c'est les réponses parfois obtenues lorsqu'on demande
combien voyez vous de carrés ?
@+
StephaneIl faudrait modifier un tantinet les questions :
1.
À partir d'un seul carré sauriez-vous en obtenir
exactement neuf en traçant quatre segments
de droite à l'intérieur du carré initial.
2.
À partir d'un seul carré sauriez-vous en obtenir
exactement quatorze en traçant quatre segments
de droite à l'intérieur du carré initial.
Et je me demande quelle est la question la plus difficile ;-)
A+
Serge
"LSteph" a écrit dans le message de news:...
je vois donc une variante:
2 segments verticaux à une distance chacun de un tiers de côté du carré.
2 horizontaux idem , et nous voilà bien neuf carrés cette fois ci égaux
Sauf que...
sauriez vous en obtenir neuf... ,et bien cela fera dix avec celui du pourtour
+4 si l'on considère les 4 groues de 4 carrés situés à l'intérieur,
soit 14 carrés en tout.
@+
lStephBonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
Salut Stéphane,
En voici une moins bébé lala ;-)))
Placer tous les nombres entiers de 1 à 16 dans
une grille 4x4 de telle sorte que les sommes de
chaque ligne, chaque colonne et chaque diagonale
soient différentes. De plus ces dix sommes doivent
former une suite de nombres consécutifs.
Serais curieux de voir le code VBA qui pourrait
répondre à ça. Je vais très peut-être essayer ;-)
Serge
"LSteph" <lecocosteph@frite.fr> a écrit dans le message de news: ug2BXvbkHHA.3472@TK2MSFTNGP04.phx.gbl...
...ce qui peut être assez surprenant ou amusant c'est les réponses parfois obtenues lorsqu'on demande
combien voyez vous de carrés ?
@+
Stephane
Il faudrait modifier un tantinet les questions :
1.
À partir d'un seul carré sauriez-vous en obtenir
exactement neuf en traçant quatre segments
de droite à l'intérieur du carré initial.
2.
À partir d'un seul carré sauriez-vous en obtenir
exactement quatorze en traçant quatre segments
de droite à l'intérieur du carré initial.
Et je me demande quelle est la question la plus difficile ;-)
A+
Serge
"LSteph" <lecocosteph@frite.fr> a écrit dans le message de news: OOU8QhbkHHA.1388@TK2MSFTNGP05.phx.gbl...
...
je vois donc une variante:
2 segments verticaux à une distance chacun de un tiers de côté du carré.
2 horizontaux idem , et nous voilà bien neuf carrés cette fois ci égaux
Sauf que...
sauriez vous en obtenir neuf... ,et bien cela fera dix avec celui du pourtour
+4 si l'on considère les 4 groues de 4 carrés situés à l'intérieur,
soit 14 carrés en tout.
@+
lSteph
Bonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge
Salut Stéphane,
En voici une moins bébé lala ;-)))
Placer tous les nombres entiers de 1 à 16 dans
une grille 4x4 de telle sorte que les sommes de
chaque ligne, chaque colonne et chaque diagonale
soient différentes. De plus ces dix sommes doivent
former une suite de nombres consécutifs.
Serais curieux de voir le code VBA qui pourrait
répondre à ça. Je vais très peut-être essayer ;-)
Serge
"LSteph" a écrit dans le message de news:...ce qui peut être assez surprenant ou amusant c'est les réponses parfois obtenues lorsqu'on demande
combien voyez vous de carrés ?
@+
StephaneIl faudrait modifier un tantinet les questions :
1.
À partir d'un seul carré sauriez-vous en obtenir
exactement neuf en traçant quatre segments
de droite à l'intérieur du carré initial.
2.
À partir d'un seul carré sauriez-vous en obtenir
exactement quatorze en traçant quatre segments
de droite à l'intérieur du carré initial.
Et je me demande quelle est la question la plus difficile ;-)
A+
Serge
"LSteph" a écrit dans le message de news:...
je vois donc une variante:
2 segments verticaux à une distance chacun de un tiers de côté du carré.
2 horizontaux idem , et nous voilà bien neuf carrés cette fois ci égaux
Sauf que...
sauriez vous en obtenir neuf... ,et bien cela fera dix avec celui du pourtour
+4 si l'on considère les 4 groues de 4 carrés situés à l'intérieur,
soit 14 carrés en tout.
@+
lStephBonsoir,
À partir d'un seul carré sauriez-vous en obtenir
neuf en traçant quatre segments de droite à
l'intérieur du carré initial.
Si vous n'arrivez pas à resoudre cette énigme,
la macro suivante le fera pour vous ;-)
Sub De_Un_A_Neuf()
Sheets.Add
ActiveWindow.DisplayGridlines = False
With ActiveSheet
Set forme = .Shapes.AddShape(msoShapeRectangle, 50, 50, 150, 150)
forme.Name = "carré"
Set r = .Shapes("carré")
r.Line.ForeColor.SchemeColor = 10
DoEvents
MsgBox "Le premier carré.", vbInformation, " De un à neuf"
lc = r.Left
tc = r.Top
wc = r.Width
hc = r.Height
x1 = lc + wc / 2
y1 = tc
x2 = lc + wc / 2
y2 = tc + hc
Set s1 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc
y1 = tc + hc / 2
x2 = lc + wc
y2 = tc + hc / 2
Set s2 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + 3 * wc / 4
y1 = tc
x2 = lc + 3 * wc / 4
y2 = tc + hc / 2
Set s3 = .Shapes.AddLine(x1, y1, x2, y2)
x1 = lc + wc / 2
y1 = tc + hc / 4
x2 = lc + wc
y2 = tc + hc / 4
Set s4 = .Shapes.AddLine(x1, y1, x2, y2)
DoEvents
MsgBox "Quatre segments de droite en donnent neuf !" _
& vbNewLine & "Cliquez sur OK pour les voir.", vbExclamation, " De un à neuf"
Set un = .Shapes.AddShape(msoShapeRectangle, lc + 250, tc, wc, hc)
Set deux = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 165, wc / 2, hc / 2)
Set trois = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 165, wc / 2, hc / 2)
Set quatre = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 255, wc / 2, hc / 2)
Set cinq = .Shapes.AddShape(msoShapeRectangle, lc + 375, tc + 255, wc / 2, hc / 2)
Set six = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc, wc / 4, hc / 4)
Set sept = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc, wc / 4, hc / 4)
Set huit = .Shapes.AddShape(msoShapeRectangle, lc + 200, tc + 3 * hc / 4, wc / 4, hc / 4)
Set Neuf = .Shapes.AddShape(msoShapeRectangle, lc + 412, tc + 3 * hc / 4, wc / 4, hc / 4)
End With
End Sub
Serge