Two array-bugs
-
I have come across what seems to be two bugs connected with the colon-notation for arrays.
1: It seems arrays defined using colon-notation stops being printable after being expanded more than once.
subArr = [0, 1][:0] subArr[len(subArr)] = 1 subArr[len(subArr)] = 2 print(subArr)
This returns the following error: "Unknown type: 1433908896"
Printing the length of the array works, so it "is there", but cannot be printed.
Printing the list before the second expansion also works fine.2: len() does not work with colon notation.
arr1 = [0, 1] arr2 = [0] arr3 = arr1[:len(arr2)]
This returns an error message telling me that the function len does not exist.
It can be bypassed by adding the following:function len(x) return len(x)
I hesitate a bit posting here, because I'm so new to programming that I'm seldom confident that the mistake is not with me, but this seems very strange.
-
I’ve encountered the same problem with colon notation. It’s best to do all your operations on a separate variable first (such as Len) then place that new variable in your colon notation.
I’ve also found anomalies if I didn’t spread these operations out on multiple lines. It ends up just clearing the array if I do too many operations in one line.
-
Please be aware that accessing arrays with this "colon notation" is not officially supported, please check the online help for the most up to date help (https://fuzearena.com/help).