I am busy with a Kakuro game and would like to use the Map type. In my Process_Globals i have declared the following:
Type SplitBlk (Index As Int, HorLen As Int, HorVal As Int, VerLen As Int, VerVal As Int)
Dim SplitBlock As Map, spBlk As SplitBlk
Then i have the following sub where I Put an index and spBlk of SplitBlk type in the map. My problem is that if I look at my Map at the end of the loop, I have all the index's I have added, but all the values in spBlk are the same. They are all equal to the values of the last spBlk added?
Sub CalcNumbers
ind = 0
Do While ind < modGenOplos.aSelle
If kKur(ind).Tipe = Tipe.Split Then
spBlk.Initialize
spBlk.Index = ind
CalcSplitRight(spBlk)
CalcSplitDown(spBlk)
SplitBlock.Put(ind,spBlk)
End If
ind = ind + 1
Loop
End Sub
Type SplitBlk (Index As Int, HorLen As Int, HorVal As Int, VerLen As Int, VerVal As Int)
Dim SplitBlock As Map, spBlk As SplitBlk
Then i have the following sub where I Put an index and spBlk of SplitBlk type in the map. My problem is that if I look at my Map at the end of the loop, I have all the index's I have added, but all the values in spBlk are the same. They are all equal to the values of the last spBlk added?
Sub CalcNumbers
ind = 0
Do While ind < modGenOplos.aSelle
If kKur(ind).Tipe = Tipe.Split Then
spBlk.Initialize
spBlk.Index = ind
CalcSplitRight(spBlk)
CalcSplitDown(spBlk)
SplitBlock.Put(ind,spBlk)
End If
ind = ind + 1
Loop
End Sub
Last edited: