I got it working with:

    for i = 1:51
      for j = 1:23
        r.Board[i,j] = json["Board"][i][j]["Name"]
      end
    end

I would like to better understand what the checkbounds error does.

Now that I've done this imperatively, is there a better way I could parse 
this nested array of json::Dict? I was playing with the tparse.jl gist and 
it seemed to be looping though json::dict as well.


On Thursday, March 27, 2014 11:11:44 AM UTC-4, Collin Glass wrote:
>
> r being of type Response with some other game state data.
>
> On Thursday, March 27, 2014 11:09:10 AM UTC-4, Collin Glass wrote:
>>
>> They are not actually in my code. They represent the rest of the 23x51 
>> cells.
>>
>> Here is the basic rowxcolumn for loops I'm using to parse:
>>
>> for i in json["Board"]
>>    for j in json["Board"][i]
>>       r.Board[i,j] = json["Board"][i][j]["Name"]
>>    end
>> end
>>
>> When I use while i <= 5 it parses.
>>
>> On Thursday, March 27, 2014 2:06:42 AM UTC-4, Collin Glass wrote:
>>>
>>> Hi, I'm creating a TCP client for a bomberman game in Julia. I need to 
>>> parse the current state of the gameboard (which is a lot of tiles).
>>>
>>> Sample JSON,
>>>
>>>
>>> {{["Name"=>"Wall"],["Name"=>"Wall"],["Name"=>"Wall"],["Name"=>"Rock"],...},{...,["Name"=>"Wall"],...},...}
>>>
>>> I am new to Julia, as such I am intrigued to make use of the 
>>> Array{Cell,2}. to represent my board.
>>>
>>> The board is 23rowx51column.
>>>
>>> I seem to be getting the following error.
>>>
>>>
>>> MethodError(checkbounds,(51,{["Name"=>"Wall"],["Name"=>"Wall"],["Name"=>"Wall"],...})
>>>
>>> I took a look at the abstractarray.jl in base, but didn't get any 
>>> answers.
>>>
>>> Is there a limit on the size of the array?
>>>
>>

Reply via email to