@TwistedTwigleg Thanks for the welcoming and the reply.
While It may have to do with characters been turn into ASCII it seems to be something more going on I thought maybe I could use it to my advantage but I cant manage to get the expected result all the time.
Some more testing with 2d arrays:
[["aza"],["aba"],["aaa"]] max: ["aza"] min: ["aza"]
[["a6a"],["aaa"],["aa"]] max: ["aaa"] min: ["aaa"]
It gets more confusing with uppercase letters.
[["aa"],["aaa"],["A"]] max: ["aaa"] min: ["aaa"]
[["aa"],["aaa"],["AAA"]] max: ["aaa"] min: ["aaa"]
[["aaa"],["Aaa"],["AAA"]] max: ["aaa"] min: ["aaa"]
[["aaa"],["Aaz"],["AAA"]] max: ["aaa"] min: ["aaa"]
[["aaa"],["aaz"],["AAA"]] max: ["aaz"] min: ["aaz"]
I seems to compare only the very first character and if it has the same value it goes to the next one:
[["aba"],["aaz"],["AcA"],["baA"]] max: ["baA"] min: ["baA"]
[["abc"],["zxy"],["ABC"],["ZXY"]] max: ["zxy"] min: ["zxy"]
With 1d arrays everything works as expected lowercase characters with higher values got picked by max() and uppercase which have lower values than their homonymous in lowercases got picked by min().
["abc","zxy","ABC","ZXY"] max: zxy min: ABC
[["abc"],["zxy"],["ABC"],["ZXY"]] max:[zxy] min: [zxy]
Integers act the same way as strings in 2d arrays.
[[0],[7],[8]] max: [8] min: [8]
[0,7,8] max: 8 min: 0
But negative values result in different results and this may be because of the ASCII or UNICODE conversion taking in consideration the "-" simbol but when there's no string inside the 2d array it didn't care about the negative value unlike the 1d array.
[["a",0],["a",7],["a",8],["a",-0]] max: ["a",8] min: ["a",0]
[[0],[7],[8],[-0]] max: [8] min: [8]
[[1],[7],[8],[-10]] max: [8] min: [8]
[1,7,8,-0] max: 8 min: 0
TLDR: I think min()
is malfunctioning in 2d arrays.
The best way would be to check the source code but I never used github before and the only language I know is Gdscript so I don't think I could understand the C++ source code. Also I can work around it easily.