utils.js

// String Constants
const EMPTY_STRING = ''
const BLANK_SPACE = ' '
const NEWLINE = '\n'
const LOST = 'LOST'

/**
 * Coordinates to control the orientation of the robot
 */
const COORDS = {
  N: 'N',
  S: 'S',
  E: 'E',
  W: 'W'
}

/**
 * Possible values for instructions. Turn left, turn right or move forward, according to the orientation
 */
const INSTRUCTIONS = {
  LEFT: 'L',
  RIGHT: 'R',
  FORWARD: 'F'
}

/**
 * Object with Error Messages
 */
const ERRORS = {
  GRID_NO_GREATER_50_50: 'Grid size cannot be greater than 50x50',
  GRID_NO_SMALLER_1_1: 'Grid size cannot be smaller than 1x1',
  INSTRUCTIONS_NO_GREATER_100: 'Robot instructions cannot be greater than 100 characters'
}

module.exports = {
  BLANK_SPACE,
  EMPTY_STRING,
  NEWLINE,
  LOST,
  COORDS,
  INSTRUCTIONS,
  ERRORS
}