Skip to content

Instantly share code, notes, and snippets.

View matiasmicheletto's full-sized avatar
🏠
Working from home

Matias Micheletto matiasmicheletto

🏠
Working from home
View GitHub Profile
@celaus
celaus / pmx.js
Created August 25, 2018 21:19
PMX - Partially Mapped Crossover
function x(s, t) {
let _map1 = {};
let _map2 = {};
const x1 = Math.floor(Math.random() * (s.length - 1));
const x2 = x1 + Math.floor(Math.random() * (s.length - x1));
let offspring = [Array.from(s), Array.from(t)];
@ysangkok
ysangkok / smallqm.js
Created June 4, 2013 16:06
Quine-McCluskey in JavaScript
"use strict";
// from http://stackoverflow.com/a/11454049/309483
var combine = function (m, n) {
var a = m.length, c = '', count = 0, i;
for (i = 0; i < a; i++) {
if (m[i] === n[i]) {
c += m[i];
} else if (m[i] !== n[i]) {