Skip to content

amitayd/regexp-golf-coffeescript

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 

regexp-golf-coffeescript

Regular expression golf (finding a short regexp for a set) implemented in coffeescript

See blog post @ http://www.doboism.com/blog/2014/01/19/coffeescript-regex-golf

###How to run###

Main Coffee under Node:

coffee src/main.js

In code or in the console:

regexpGolf = require('./src/regexpGolf.coffee')
Set = require('./src/set.coffee')

winners =  new Set(['fireman', 'trucker', 'samurai', 'chef'])
losers = new Set(['lawyer', 'senator', 'waiter', 'chief'])

settings = {
  randomFactor: 1
  branches: 2
  depthBranches: {}
}

console.log regexpGolf.find(winners, losers, settings)

For the browser: open browser/index.html

Test and build

Install grunt-cli and the package

sudo npm install -g grunt-cli
npm install .

grunt

About

Regular expression golf (finding a short regexp for a set) implemented in coffeescript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published