Re: what is wrong with this code??

2015-10-17 Thread anonymous via Digitalmars-d-learn
On Saturday, October 17, 2015 04:17 PM, steven kladitis wrote:

> // it thows a range exception

On which line?


Re: what is wrong with this code??

2015-10-17 Thread anonymous via Digitalmars-d-learn
On Saturday, October 17, 2015 04:50 PM, steven kladitis wrote:

> core.exception.RangeError@sokuban.d(84): Range violation

Line 84 being this:

sDataBuild ~= sMap[ch];


Where sMap is:

/*static*/ immutable sMap =
[' ':' ', '.':'.', '@':' ', '#':'#', '$':' '];


Apparently, ch is some char that's not a key in sMap. Try printing out ch to 
see what it is exactly. Then, assuming it's really not a key in sMap, figure 
out if sMap should have that key, or if ch should not end up with that 
value.


Re: what is wrong with this code??

2015-10-17 Thread steven kladitis via Digitalmars-d-learn

On Saturday, 17 October 2015 at 14:47:11 UTC, anonymous wrote:

On Saturday, October 17, 2015 04:17 PM, steven kladitis wrote:


// it thows a range exception


On which line?


core.exception.RangeError@sokuban.d(84): Range violation


Re: what is wrong with this code??

2015-10-17 Thread steven kladitis via Digitalmars-d-learn

On Saturday, 17 October 2015 at 14:59:41 UTC, anonymous wrote:

On Saturday, October 17, 2015 04:50 PM, steven kladitis wrote:


core.exception.RangeError@sokuban.d(84): Range violation


Line 84 being this:

sDataBuild ~= sMap[ch];


Where sMap is:

/*static*/ immutable sMap =
[' ':' ', '.':'.', '@':' ', '#':'#', '$':' '];


Apparently, ch is some char that's not a key in sMap. Try 
printing out ch to see what it is exactly. Then, assuming it's 
really not a key in sMap, figure out if sMap should have that 
key, or if ch should not end up with that value.


Yes!!! Now it makes sense!!!  Thanks