This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Non-canvas Worms Game. Copyright (c) by Fredrik Johansson 2020. [email protected]. | |
class WormGame { | |
constructor(el, grid) { | |
let t = this; | |
t.el = el; | |
t.config = { | |
grid: { ...{ | |
size: 18, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 :) |