Microsoft Small Basic

Program Listing: KNT157
' Original (French) version PTX661 coded by ErmiteUrbain
' English version translated by Nonki Takahashi

' £ £ £ = Image Address at web host
GraphicsWindow.Title = " Help for ** Chaos Su Do Ku **"
GraphicsWindow.BackgroundColor = "LightCyan"
GraphicsWindow.MouseUp = ClikSouris
GraphicsWindow.KeyUp = TouchClavier
GraphicsWindow.Width = 716
GraphicsWindow.Height = 617
GraphicsWindow.FontName = "Tahoma"
GraphicsWindow.BrushColor = GraphicsWindow.BackgroundColor
GraphicsWindow.FillRectangle(0, 0, GraphicsWindow.Width, GraphicsWindow.Height)
GraphicsWindow.BrushColor = "Black"'
'Color Declaration of Each Region Numbered from 0 to 8
Coul = "0=#FFA3B1;1=#E5AA7A;2=#6DD926;3=#AA8855;4=#D3F9BC;5=#9DBB61;6=#99D9EA;7=#709AD1;8=#B5A5D5"
Cr = Text.GetCharacter(13)
Chemin = Program.Directory + "\"
' £ £ £ The condition that makes sure that Path matches the file at are the image files
'no interest if you keep the lines with the links of the image bank, you can turn in lines 18 to 24
' The following line could be harmful and has been automatically commented.
' W = File.GetFiles(Chemin)
If (Text.IsSubText(W, "chk01.bmp") <> "True") Then
W = "The files:" + Cr + " chk01.bmp" + Cr + " chk03E.bmp" + Cr + "must be in the same directory as this executable"
GraphicsWindow.ShowMessage(W,"Error: File Not Found")
Program.End()
EndIf
W = ""
optAction[0] = ImageList.LoadImage(Chemin + "chk03E.bmp")
' £ £ £ optAction[0] = ImageList.LoadImage("http://nsa39.casimages.com/img/2018/04/18/180418012249121437.jpg")
optAction[1] = ImageList.LoadImage(Chemin + "chk01.bmp")
' £ £ £ optAction[1] = ImageList.LoadImage("http://nsa39.casimages.com/img/2018/04/18/180418031821477420.jpg")
TexteOpt = "0=Final Value;1=Delete a possible value;2=Highlight remaining box"
GraphicsWindow.PenColor = "yellow"
For i = 0 To 80
Stabilo[i] = Shapes.AddEllipse(34, 38)
Shapes.HideShape(Stabilo[i])
Shapes.SetOpacity(Stabilo[i], 75)
EndFor
' Button "?" to provide explanation on the program flow
cmdAide = Controls.AddButton(" ? ", GraphicsWindow.Width - 55, 20)
Controls.SetSize(cmdAide, 35, 35)
cmdIndice = Controls.AddButton("Research evidence", 519, 420)
Controls.SetSize(cmdIndice, 132, 26)
Controls.HideControl(cmdIndice)
cmdCachePossible = Controls.AddButton("Hide Possible", 519, 460)
Controls.SetSize(cmdCachePossible, 132, 26)
Controls.HideControl(cmdCachePossible)
cmdNouveau = Controls.AddButton("New Grid", 519, 500)
Controls.HideControl(cmdNouveau)
Controls.SetSize(cmdNouveau, 132, 26)
Controls.ButtonClicked = ClikBouton
Main()
Sub Main
ChxOpt = 0
Etape = "Entering Region"' variable including the follow-up of the steps of the program for the management of the events
ChoixCoulPaver = 0'variable determining the region color being entered
PointCoul = "White" 'variable recevant la couleur du pixel cliquer
CacherPossible = "False"
Larg = 48
Haut = 56
GraphicsWindow.FontSize = 16
For i = 0 To 9
GraphicsWindow.FillRectangle(20 , i * Haut + 20, 434, 2)
GraphicsWindow.FillRectangle(i * Larg + 20, 20, 2, 506)
EndFor
' The following line could be harmful and has been automatically commented.
' If Text.IsSubText(File.GetFiles(Chemin), "CoulGri.txt") Then 'Part in Course
' The following line could be harmful and has been automatically commented.
' MemoGrilCoul = File.ReadLine(Chemin + "CoulGri.txt", 1)
' The following line could be harmful and has been automatically commented.
' MaxCoup = File.ReadLine(Chemin + "CoulGri.txt", 2)
' The following line could be harmful and has been automatically commented.
' TabGri = File.ReadLine(Chemin + "StockCoup.txt", MaxCoup)
EnCours = MaxCoup
InitEtapeSaisieChiffre()
Else' start normally
GraphicsWindow.DrawText(100, 552,"Delimit the 9 regions of the grid")
GraphicsWindow.DrawImage(ImageList.LoadImage(Chemin + "CoulRegion.bmp"), 500, 179)
' £ £ £ GraphicsWindow.DrawImage(ImageList.LoadImage("http://nsa39.casimages.com/img/2018/04/20/180420111207546577.jpg"), 500, 179)
GraphicsWindow.SetPixel(0,0,"yellow")
GraphicsWindow.Show()
'initialize the Grid
For i = 0 to 8
CoulExiste[i] = 0
For a = 0 To 8
MemoGrilCoul[i][a] = -1
MemoGrilCoul[i][a] = -1
TabGri[i][a][0] = 0
For b = 1 To 9
TabGri[i][a][b] = 1
EndFor
EndFor
EndFor
GriX = 0' position X of the box of the grid being processed
GriY = 0' position Y of the box of the grid being processed
EndIf
EndSub
'################################## Mouse Event Management #####################################################
Sub ClikSouris
If w = "First time" Then
w = ""
EndIf
If Shapes.GetLeft(Stabilo[0]) > 0 Then
EffaceStabilo()
EndIf
xSou = GraphicsWindow.MouseX
ySou = GraphicsWindow.MouseY
PointCoul = GraphicsWindow.GetPixel(xSou,ySou)
If Etape = "Entering Region" Then
If (xSou > 501) And (xSou < 662) And (ySou > 180) And (ySou < 365) Then 'Test Click on Color Box Zone
If (PointCoul <> "LightCyan") And (PointCoul <> "#DCDCDC") Then 'Test that the color of the click is not that of the frame or the bottom
GraphicsWindow.PenColor = "#DCDCDC"
GraphicsWindow.DrawRectangle(Math.Remainder(ChoixCoulPaver , 3) * 57 + 501, Math.Floor(ChoixCoulPaver / 3) * 65 + 180, Larg, Haut)
ChoixCoulPaver = Math.Floor((ySou - 181)/ 65) * 3 + Math.Floor((xSou - 502) / 57)' Memorize the chosen color
GraphicsWindow.PenColor = "Black"
If CoulExiste[ChoixCoulPaver] = 9 Then
GraphicsWindow.PenColor = "Red"
EndIf
GraphicsWindow.DrawRectangle(Math.Remainder(ChoixCoulPaver , 3) * 57 + 501, Math.Floor(ChoixCoulPaver / 3) * 65 + 180, Larg, Haut)
EndIf
ElseIf (xSou > 21) And (xSou < 452) And (ySou > 21) And (ySou < 524) Then 'Test Click on Grid Zone
GriX = Math.Floor((xSou - 22 ) / Larg)
GriY = Math.Floor((ySou - 22 ) / Haut)
If MemoGrilCoul[GriX][GriY] <> -1 Then ' Test If Grid Case Is Already Assigned To A Region
MemoGrilCoul[GriX][GriY] = -1 ' Clear saved color at GriX, GriY
i = 0
While Coul[i] <> PointCoul ' Look what color of the box is to remove
i = i + 1
EndWhile
CoulExiste[i] = CoulExiste[i] - 1
GraphicsWindow.BrushColor = "LightCyan"
GraphicsWindow.FillRectangle(GriX * Larg + 22, GriY * Haut + 22, 46, 54)
GraphicsWindow.PenColor = "Black"
GraphicsWindow.DrawRectangle(Math.Remainder(ChoixCoulPaver , 3) * 57 + 501, Math.Floor(ChoixCoulPaver / 3) * 65 + 180, Larg, Haut)
Else'Click on blank case
If CoulExiste[ChoixCoulPaver] <> 0 Then'test if box of the same color exists
' Test that the box is part of a * BLOCK * not being the first of this color
If (MemoGrilCoul[GriX - 1][GriY] = ChoixCoulPaver) Or (MemoGrilCoul[GriX + 1][GriY] = ChoixCoulPaver) Or (MemoGrilCoul[GriX][GriY - 1] = ChoixCoulPaver) Or (MemoGrilCoul[GriX][GriY +1] = ChoixCoulPaver) Then
If CoulExiste[ChoixCoulPaver] < 9 Then 'Test that the block-region does not already have 9 boxes
DesEtMemoCoulGri()
If CoulExiste[ChoixCoulPaver] = 9 Then
W = GraphicsWindow.PenColor
GraphicsWindow.PenColor = "Red"
GraphicsWindow.DrawRectangle(Math.Remainder(ChoixCoulPaver , 3) * 57 + 501, Math.Floor(ChoixCoulPaver / 3) * 65 + 180, Larg, Haut)
GraphicsWindow.PenColor = W
EndIf
Else
GraphicsWindow.ShowMessage(" A region is constitute of 9 boxes" ," Error: Too many boxes in a region")
EndIf
Else
GraphicsWindow.ShowMessage(" Boxes of a region must form a block" ," Error: incorrect layout")
EndIf
Else'adds color directly to the first region box
DesEtMemoCoulGri()
EndIf
'Test grid finished
i = 0
While CoulExiste[i] = 9
i = i + 1
EndWhile
If i = 9 Then ' entering regions finish
MaxCoup = 1 'variable for management read StockCoup file
' The following line could be harmful and has been automatically commented.
' w = File.WriteLine(Chemin + "CoulGri.txt", 1, MemoGrilCoul)
' The following line could be harmful and has been automatically commented.
' w = File.WriteLine(Chemin + "CoulGri.txt", 2, MaxCoup)
' The following line could be harmful and has been automatically commented.
' w = File.WriteLine(Chemin + "StockCoup.txt", MaxCoup, TabGri)
InitEtapeSaisieChiffre()
EndIf
EndIf
EndIf
ElseIf Etape = "Entering Digit" Then
If (xSou > 21) And (xSou < 452) And (ySou > 21) And (ySou < 524) Then 'Test Clik sur Zone Grille
GriX = Math.Floor((xSou - 22 ) / Larg)
GriY = Math.Floor((ySou - 22 ) / Haut)
DesCaseActiveJaune()
ElseIf (xSou > 480) And (xSou < 689) And (ySou > 118) And (ySou < 215) Then 'Test Clik sur Zone frame effet
ChxOpt = Math.Floor((ySou - 119) / 32)
GestionAfficheOptAction()
EndIf
EndIf
EndSub
'################################### Keyboard Event Management ############################################
Sub TouchClavier
If w = "First time" Then
w = ""
EndIf
If Shapes.GetLeft(Stabilo[0]) > 0 Then
EffaceStabilo()
EndIf
If Etape = "Entering Digit" Then
Touche = GraphicsWindow.LastKey
If Touche = "Left" Then
GriX = GriX - 1
If GriX = -1 Then
GriX = 8
EndIf
DesCaseActiveJaune()
ElseIf Touche = "Up" Then
GriY = GriY - 1
If GriY = -1 Then
GriY = 8
EndIf
DesCaseActiveJaune()
ElseIf Touche = "Right" Then
GriX = GriX + 1
If GriX = 9 Then
GriX = 0
EndIf
DesCaseActiveJaune()
ElseIf Touche = "Down" Then
GriY = GriY + 1
If GriY = 9 Then
GriY = 0
EndIf
DesCaseActiveJaune()
ElseIf Text.StartsWith(Touche, "NumPad") Then ' digit typing management
Num = Text.GetSubText(Touche, 7, 1)
If ChxOpt = 2 Then'Highlight the box containing num as possible
GraphicsWindow.PenColor = "Black"
GraphicsWindow.DrawRectangle (GriX * Larg + 21, GriY * Haut + 21, Larg, Haut) 'draws current yellow outline in black
i = 0
For a = 0 To 8
For b = 0 To 8
If TabGri[a][b][Num] = 1 Then
Shapes.Move(Stabilo[i], a * Larg + 28, b * Haut + 29)
Shapes.ShowShape(Stabilo[i])
i = i + 1
EndIf
EndFor
EndFor
If i > 0 Then
GraphicsWindow.DrawEllipse(561, 290, Larg, Haut)
GraphicsWindow.BrushColor = 0
GraphicsWindow.FontSize = 34
GraphicsWindow.DrawText(574, 296, Num)
EndIf
ElseIf TabGri[GriX][GriY][Num] = 1 Then ' existing test of Num in the possible of the box
If ChxOpt = 0 Then 'to put a number of boxes
TabGri[GriX][GriY][0] = Num ' Case now has the value of Num
Region = MemoGrilCoul[GriX][GriY] 'mémorise l'appartenace de la case a sa région
For a = 0 to 8
TabGri[a][GriY][Num] = 0' supprime Num de ligne GriY
TabGri[GriX][a][Num] = 0' supprime Num de colonne GriX
TabGri[GriX][GriY][a + 1] = 0' supprime les possibles de la case GriX,GriY
For b = 0 to 8
If MemoGrilCoul[a][b] = Region Then ' si la case a,b est de la même région
TabGri[a][b][Num] = 0 ' supprime Num de la case région
EndIf
endfor
EndFor
Else' supprimer chiffre des possibilité
TabGri[GriX][GriY][Num] = 0
Des_Chiffre()
EndIf
DesGrille()
'MaxCoup et EnCours servent de repére pour se déplacer dans les coup effectuer, cela permet de revoir l'évolution de la résolution de la grille en cas de doute ou d'erreur
'MaxCoup est le nombre total d'action faite, EnCours lui est toujours égal si on ne fait que saisir des chiffres
'EnCour ne différe de MaxCoup quand lui étant inférieur, les coup vont de 1 à MaxCoup et Encours est compris dans cet interval en cas retour a un coup précédent
If MaxCoup = EnCours Then
MaxCoup = MaxCoup + 1 ' l'enregistrement des coup continu normalement
Else
MaxCoup = EnCours + 1 'en retour a été effectuer, l'enregistrement reprend a partir de ce point
EndIf
EnCours = MaxCoup' une saise de chiffre étant effectuer Encour redevien égal de MaxCoup
' The following line could be harmful and has been automatically commented.
' w = File.WriteLine(Chemin + "CoulGri.txt", 2, MaxCoup)
' The following line could be harmful and has been automatically commented.
' w = File.WriteLine(Chemin + "StockCoup.txt", MaxCoup, TabGri)
Else' traitement message d''erreur de saisie de Num
If ChxOpt = 0 Then 'mettre chiffre la casse
GraphicsWindow.ShowMessage(" The value of this box can not be " + Num + ".", "Error: Entering Digit")
Else' supprimer chiffre des possibilité
GraphicsWindow.ShowMessage(Num + " is no longer part of the possibilities of this box.", "Erreur : Supprimer une possiblité")
EndIf
EndIf
ElseIf (Touche = "Subtract") And (EnCours > 1) Then
EnCours = EnCours - 1
' The following line could be harmful and has been automatically commented.
' TabGri = File.ReadLine(Chemin + "StockCoup.txt", EnCours)
DesGrille()
ElseIf (Touche = "Add") And (EnCours < MaxCoup) Then
EnCours = EnCours + 1
' The following line could be harmful and has been automatically commented.
' TabGri = File.ReadLine(Chemin + "StockCoup.txt", EnCours)
DesGrille()
EndIf
EndIf
EndSub
'####################################### Gestion Bouton ##### #################################################
Sub ClikBouton
If Controls.LastClickedButton = "Button1" Then 'Bouton Aide
If Etape = "Entering Region" Then
w = "Click on a white box in the grid to assign it to the selected color region" + Cr + Cr
w = w + "Click on a colored box of the grid to cancel its assignment" + Cr + Cr
w = w + "Click on a color in the palette to the right of the grid to change region"
GraphicsWindow.ShowMessage(w, " Help: Delimitation of regions")
ElseIf Etape = "Entering Digit" Then
w = "Directional arrow or mouse click to move the active box circling in yellow" + Cr + Cr
w = w + "Digit of the numeric keypad to achieve the " + Text.GetCharacter(34) +"effect" + Text.GetCharacter(34) + " select" + Cr + Cr
w = w + "Key - and + to view or return to a step in your path"
GraphicsWindow.ShowMessage(w, " Help: Grid Resolution")
EndIf
ElseIf Controls.LastClickedButton = "Button2" Then 'Bouton Recherche indice
Resultat = "Non"' pour éviter plusieurs réponse d'affiler si le cas se présente
For a = 0 To 8' test simple si une seule possibilité dans une case
For b = 0 To 8
NbFois = 0
For i = 1 To 9
NbFois = NbFois + TabGri[a][b][i]
EndFor
If NbFois = 1 then
VS ="0=" + (a * Larg + 21) + ";1=" + (b * Haut + 21) + ";2=" + Larg + ";3=" + Haut + ";4=Case"
w = "Box C" + (a + 1) + " - L" + (b + 1) + " has only one possibility."
CaseBlanche()
EndIf
EndFor
EndFor
If Resultat = "Non" Then
For i = 1 To 9 'Passe en revus les 9 chiffre
For b = 0 To 8' test lIgne si un chiffre peux aller dans une seule case
NbFois = 0
For a = 0 To 8
NbFois = NbFois + TabGri[a][b][i]
EndFor
If NbFois = 1 Then
VS ="0=" + 21 + ";1=" + (b * Haut + 21) + ";2=" + (Larg * 9) + ";3=" + Haut + ";4=Ligne"
w = "Number " + i + " of L" + (b + 1) + " has only one possible location"
CaseBlanche()
EndIf
EndFor
If Resultat = "Non" Then
For a = 0 To 8' test Colonne si un chiffre peux aller dans une seule case
NbFois = 0
For b = 0 To 8
NbFois = NbFois + TabGri[a][b][i]
EndFor
If NbFois = 1 Then
VS ="0=" + (a * Larg + 21) + ";1=" + 21 + ";2=" + Larg + ";3=" + (Haut * 9) + ";4=Colonne"
w = "Number " + i + " of C" + (a + 1) + " has only one possible location"
CaseBlanche()
EndIf
EndFor
EndIf
EndFor
If Resultat = "Non" Then
For Region = 0 To 8
NbFois = ""
For a = 0 To 8' test Région si un chiffre peux aller dans une seule case
For b = 0 To 8
For i = 1 To 9
If MemoGrilCoul[a][b] = Region Then
NbFois[i] = NbFois[i] + TabGri[a][b][i]
EndIf
EndFor
EndFor
EndFor
For i = 1 To 9
If NbFois[i] = 1 Then
For a = 0 To 8' recherche la case de la région pour permettre un affiche
For b = 0 To 8
If (MemoGrilCoul[a][b] = Region) And (TabGri[a][b][i] = 1) Then
VS ="0=" + (a * Larg + 21) + ";1=" + (b * Haut + 21) + ";2=" + Larg + ";3=" + Haut + ";4=Région"
w = "At region level, the number " + i + " can only be in the box C" + (a + 1) + " - L" + (b + 1) + "."
CaseBlanche()
Region = 8
EndIf
EndFor
EndFor
EndIf
EndFor
EndFor
NbFois = ""
EndIf
EndIf
If Resultat = "Oui" Then
For i = 0 To 9
GraphicsWindow.FillRectangle(20 , i * Haut + 20, 434, 2)
GraphicsWindow.FillRectangle(i * Larg + 20, 20, 2, 506)
EndFor
DesCaseActiveJaune()
ElseIf w = "First time" Then
w = ""
EndIf
ElseIf Controls.LastClickedButton = "Button3" Then 'Bouton Cacher possible
If w = "First time" Then
w = ""
EndIf
CacherPossible = "True"
DesGrille()
ElseIf Controls.LastClickedButton = "Button4" Then 'Bouton Nouvelle Grille
If w = "First time" Then
If Shapes.GetLeft(Stabilo[0]) > 0 Then
EffaceStabilo()
EndIf
Controls.HideControl(cmdIndice)
Controls.HideControl(cmdCachePossible)
Controls.HideControl(cmdNouveau)
' The following line could be harmful and has been automatically commented.
' File.DeleteFile(Chemin + "CoulGri.txt")
' The following line could be harmful and has been automatically commented.
' File.DeleteFile(Chemin + "StockCoup.txt")
GraphicsWindow.BrushColor = GraphicsWindow.BackgroundColor
GraphicsWindow.FillRectangle(0, 0, GraphicsWindow.Width, GraphicsWindow.Height)
GraphicsWindow.BrushColor = "Black"'
Main()
Else
w = "Warning! The grid data will be lost" + Cr + Cr + " - Press a 2nd button to confirm"
w = w + Cr + Cr + " - Or resume the course of your game to continue"
GraphicsWindow.ShowMessage(w, " New Grid")
w = "First time"
EndIf
EndIf
EndSub
'#########################################################################################################
Sub Des_Chiffre
GraphicsWindow.BrushColor = Coul[MemoGrilCoul[GriX][GriY]]
GraphicsWindow.FillRectangle(GriX * Larg + 22, GriY * Haut + 22, 46, 54)
GraphicsWindow.BrushColor = "Black"
If (TabGri[GriX][GriY][0] = 0) Then
If CacherPossible = "False" Then
GraphicsWindow.FontSize = 16
For i = 0 to 8
If TabGri[GriX][GriY][i + 1] = 1 Then 'écrit le chiffre s'il existe
GraphicsWindow.DrawText((GriX * Larg) + (Math.Remainder(i, 3) * 15) + 25, (GriY * Haut) + (Math.Floor(i / 3) * 16) + 23, i + 1)
EndIf
EndFor
EndIf
Else
GraphicsWindow.FontSize = 34
GraphicsWindow.DrawText(GriX * Larg + 34, GriY * Haut + 27, TabGri[GriX][GriY][0])
EndIf
EndSub
'#########################################################################################################
Sub DesEtMemoCoulGri
MemoGrilCoul[GriX][GriY] = ChoixCoulPaver ' Mémorise lL'appartenance De La Casse A Une Région
CoulExiste[ChoixCoulPaver] = CoulExiste[ChoixCoulPaver] + 1 ' Agrémente le Nombre De Cases De Cette Région
GraphicsWindow.BrushColor = Coul[ChoixCoulPaver]
GraphicsWindow.FillRectangle(GriX * Larg + 22, GriY * Haut + 22, 46, 54)
EndSub
'#########################################################################################################
Sub DesCaseActiveJaune
GraphicsWindow.PenColor = "Black"
GraphicsWindow.DrawRectangle (AncGriX * Larg + 21, AncGriY * Haut + 21, Larg, Haut) 'dessine contour actuel Jaune en Noir
GraphicsWindow.PenColor = "yellow" '
GraphicsWindow.DrawRectangle (GriX * Larg + 21, GriY * Haut + 21, Larg, Haut) 'dessine contour nouvelle position en jaune
AncGriX = GriX
AncGriY = GriY
EndSub
'#########################################################################################################
Sub InitEtapeSaisieChiffre
For GriX = 0 to 8' Affiche toutes les solutions possible pour chaque case de la grille
For GriY = 0 To 8
Des_Chiffre()
EndFor
EndFor
' Préparation de la fenetre pour l'étape suivante
GraphicsWindow.BrushColor = GraphicsWindow.BackgroundColor
GraphicsWindow.FillRectangle(460, 160, 250, 340) 'efface palette couleur
GraphicsWindow.FillRectangle(20, 540, 430, 70) 'efface texte dessous grille
GraphicsWindow.FontSize = 16
GraphicsWindow.BrushColor = "Black"
GraphicsWindow.DrawText(56 552,"Enter the numbers to solve the grid")
GestionAfficheOptAction()
GriX = 0
GriY = 0
GraphicsWindow.PenColor = "yellow"
GraphicsWindow.DrawRectangle (GriX * Larg + 21, GriY * Haut + 21, Larg, Haut)
AncGriX = GriX 'mémorise position actuelle de GriX
AncGriY = GriY 'mémorise position actuelle de GriY
Controls.ShowControl(cmdIndice)
Controls.ShowControl(cmdCachePossible)
Controls.ShowControl(cmdNouveau)
Etape = "Entering Digit"' cette zone d'événement souris deviens obselète
CoulExiste = ""
GraphicsWindow.Show()
EndSub
'#########################################################################################################
Sub DesGrille
For GriX = 0 to 8
For GriY = 0 To 8
Des_Chiffre()
EndFor
EndFor
GriX = AncGriX
GriY = AncGriY
CacherPossible = "False"
EndSub
'#########################################################################################################
Sub GestionAfficheOptAction
GraphicsWindow.DrawImage(optAction[0], 476, 105)
GraphicsWindow.DrawImage(optAction[1], 484, ChxOpt * 32 + 130)
GraphicsWindow.BrushColor = 0
GraphicsWindow.FontSize = 12
GraphicsWindow.DrawText(504, ChxOpt * 32 + 128, TexteOpt[ChxOpt])
GraphicsWindow.FontSize = 16
EndSub
'#########################################################################################################
Sub EffaceStabilo
DesCaseActiveJaune()
For i = 0 To 80
Shapes.HideShape(Stabilo[i])
EndFor
Shapes.Move(Stabilo[0], 0, 0)
GraphicsWindow.BrushColor = GraphicsWindow.BackgroundColor
GraphicsWindow.FillRectangle(560, 280, Larg + 20, Haut + 20) 'efface numero cercler
EndSub
'#########################################################################################################
Sub CaseBlanche
GraphicsWindow.PenColor = "Black"
GraphicsWindow.DrawRectangle (GriX * Larg + 21, GriY * Haut + 21, Larg, Haut)
GraphicsWindow.PenColor = "White"
GraphicsWindow.DrawRectangle (VS[0], VS[1], VS[2], VS[3])
GraphicsWindow.ShowMessage(w, VS[4] + " a unique possibility")
Resultat = "Oui"
i = 9 'i, a et b au max permet de fermer tout les boucles for, équivalent de ExitFor sur VB6
a = 8
b = 8
VS = ""
EndSub