Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Two array-bugs

    Bug Reporting (FUZE 4 Nintendo Switch)
    3
    3
    179
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • emptytheory
      emptytheory F last edited by

      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.

      1 Reply Last reply Reply Quote 2
      • Jongjungbu
        Jongjungbu F last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • Martin
          Martin Fuze Team last edited by

          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).

          1 Reply Last reply Reply Quote 0
          • First post
            Last post