function reverseDir(dirId) {
              return dirId === DIR_UP ? DIR_DOWN :
                dirId === DIR_RIGHT ? DIR_LEFT :
                dirId === DIR_DOWN ? DIR_UP : DIR_RIGHT;
            }
@typedef {Object} DirPoint
@property {number} dirId - DIR_UP, DIR_RIGHT, DIR_DOWN, DIR_LEFT
@property {number} x
@property {number} y