Skip to content
Snippets Groups Projects
Select Git revision
  • 3f20656042f82f5f1eaf201038cfda99a2cb50d5
  • main default protected
2 results

snake.js

Blame
  • snake.js 962 B
    /* IMPORTANT: Remove these directives when you start working on the code so that
     * the linter will warn you about code style issues. */
    /* eslint-disable no-unused-vars, no-useless-constructor */
    
    import { Incidence, dijkstras } from './dijkstras.js';
    
    import { VOCABULARY } from './vocabulary.js';
    
    class Vertex {
      constructor(/* Add constructor parameters per the assignment instructions. */) {
        // Implement this constructor per the assignment instructions.
      }
    
      toKey() {
        return ''; // Implement this method per the assignment instructions.
      }
    }
    
    export function buildWordSnake(beginningLetter, targetRow, targetColumn) {
      function*getIncidences(vertex) {
        // Implement this generator function per the assignment instructions.
      }
      return dijkstras(
        new Vertex(/* Add constructor arguments per the assignment instructions. */),
        getIncidences,
        (vertex) => true, // Implement this predicate per the assignment instructions.
      );
    }