**Follow the demo's instructions after you click the green flag and look inside the project if you're having trouble understanding.** Still a work-in-progress. Use the create array blocks and set variables to the return. Then use blocks for calculations and decode array to get the result. ITEM_SIZE is the largest number of characters that your numbers can use. If it's set to 3, then 999, 3.1, and -24 will all work, but 1000 and 1.77 won't. MAX_DIMS is the most dimensions you can have. If it's set to 2, you can use the array [[2,3],[4,5]] but not [[[1],[2]],[[3],[4]]]. DIM_LENGTH is the max length of the number of items in a dimension. If it's set to 1, [1,2,3,4,5,6,7,8,9] would work but [1,2,3,4,5,6,7,8,9,0] wouldn't. Set each of them higher to be safe, but it will slow the project down. I did some (very flawed but still interesting) test runs for speed and found that performing the same calculations 1,000 times that NumScratch is: ~325x slower than NumPy when run in Scratch ~3x slower than NumPy when run in TurboWarp ~100x faster using TurboWarp instead of Scratch The numbers would definitely look different for more complex tests with larger sample sizes, but I still thought these results were worth sharing.
Based off of the Python module NumPy. You can store multidimensional arrays in variables and perform calculations on them, different from the built-in list blocks. Comments inside explain the code. Finished: - Creating Arrays (from input, all zeros, and random) - Decoding Arrays to readable form - Selecting items - Addition - Subtraction - Division - Array multiplication (Hadamard product/" * ") - Reshape - Sum - Reverse - Transpose (2D only) - Tile (no axis option) - Repeat - e^ (e to the power of array) - Length of - Shape of - Replace item In progress: - Neural network project - Dot product To do: - Log - Ravel - Arange - Matrix multiplication (common, " @ ", matmul) - Reduced and optimized 1D NumScratch - Append - Comments on functions - Optimize for speed - Add list for easier function inputs 100% original code Anyone can use