Skip to content

Instantly share code, notes, and snippets.

View fredrikdev's full-sized avatar
🐑
Reticulating Splines

Fredrik Johansson fredrikdev

🐑
Reticulating Splines
View GitHub Profile
@fredrikdev
fredrikdev / BruteForce.cs
Last active October 10, 2019 05:10
Fast, compact, non-recursive, brute force algorithm by @fredrikdev.
/*
This brute force algorithm was originally written (by me) back in 1998, and has been collecting dust
since then. However, for the purpose of testing Gist on GitHub I decided to rewrite the algorithm
from VB6 to C#, make some improvements and release this fast, compact, non-recursive, brute force
algorithm under the MIT license: http://opensource.org/licenses/MIT
Notes:
- Do a run with testLetters = "0123456789" and testLength = 3, to see what happens
- Remember to keep the callback testCalback as fast as possible
- Tweet some love to @fredrikdev :)
@fredrikdev
fredrikdev / index.js
Created May 7, 2019 17:45
SEND+MORE=MONEY Solver
// SEND+MORE=MONEY Solver. By Fredrik Johansson 2019.
// Every distinct letter needs to be a number and the equation need to solve.
const o = document.getElementById('app');
o.innerHTML = `<h1>SEND+MORE=MONEY Solver</h1>`;
// input
let formula1 = "SEND";
// +
let formula2 = "MORE";
// Non-canvas Worms Game. Copyright (c) by Fredrik Johansson 2020. fredrik@johanssonrobotics.com.
class WormGame {
constructor(el, grid) {
let t = this;
t.el = el;
t.config = {
grid: { ...{
size: 18,