Skip to content

Instantly share code, notes, and snippets.

Last active March 21, 2017 04:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
[RC Diary] For every step there's another hole to jump (-90)

[RC Diary] For every step there's another hole to jump (-90)

Implement Dijkstra's algorithm

Implemented a version using a priority queue.


I managed to have it "working" for a base, meaning that it can read a source code, read the test, mutate the source code and run source concatenated with test using mocha.

I thought I was almost there but no, I have another kind of error now, more subtle, that I didn't have before because I was just evaluating a given piece of code, far from how it looks like in reality:

// read from the source file
function check() {    
  return false
module.exports = check

// read from the test file
let assert = require('assert')
let check = require('../lib/source');

describe('simple project', () => {    
  it('returns true', () => {
    assert.equal(check(true), true);

As you can see check is declared twice. One easy fix in this case is to remove the require which imports check, some other solutions might be comparing the path of the require with the path of the file I am mutating.


  • Cerebro
  • project lamp
  • still need some attention needed for timsort, radix sort, dijkstra algo
  • chapter 3 of the little schemer in Clojure
  • allow some time to think
  • find a new apartment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment