Create a gist now

Instantly share code, notes, and snippets.

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.

Cerebro

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);
  })
})

mocha.run()

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.

Plans

  • 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