8-puzzle - Functions not working correctly

Use code tags, not quote tags. If you don't use code tags, then array indexes like [b] or [i] get treated as formatting.