Closed thareh closed 1 year ago
Seems to be related to bmx-ng/bcc#606, the values with 0 gets skipped.
Moving the ToArray function outside of the TLinkedList type seems to work.
Framework BRL.Blitz
Import BRL.Collections
Import BRL.StandardIO
Import BRL.Random
SeedRnd(MilliSecs())
Local list:TLinkedList<Int> = New TLinkedList<Int>()
For Local i:Int = 0 To 9
list.AddLast(Rand(0,1))
Next
'Local arr:Int[] = list.ToArray()
Local arr:Int[list.Count()]
Local i:Int
For Local elem:Int = EachIn list
arr[i] = elem
i :+ 1
Next
Print list.count()
Print list.LastValue()
Print
For Local val:Int = EachIn list
Print val
Next
Print
Print arr.length
Print arr[arr.length-1]
Print
For Local val:Int = EachIn arr
Print val
Next
Hey,
Sometimes the ToArray() method seems to bug out.
Thanks, -- Thareh