我使用Julia创建了一数组,试图修改其中的元素却得到了报错?

代码以及报错如下:

m, n = 10, 10
world = Array{UInt8}(undef, m, n)
world[1][1], world[1][2], world[2][1], world[2][1], world[2][2] = 1, 1, 1, 1, 1
@Expector-Hutch ➜ /workspaces/demo (main ✗) $ julia test.jl
ERROR: LoadError: MethodError: no method matching setindex!(::Int32, ::Int32, ::Int32)
Stacktrace:
 [1] top-level scope
   @ /workspaces/demo/test.jl:3
in expression starting at /workspaces/demo/test.jl:3
int·julia·arrays
66 views
Comments
登录后评论
Sign In