In this demo, backtracking algorithm is used for generating the sudoku. Difficulty and solvability is totally random as I randomly left a number of hints from a full-filled board.
A Pen by Mustafa Enes on CodePen.
In this demo, backtracking algorithm is used for generating the sudoku. Difficulty and solvability is totally random as I randomly left a number of hints from a full-filled board.
A Pen by Mustafa Enes on CodePen.
| (function () { | |
| 'use strict' | |
| var fs = require('fs') | |
| var jsdom = require('jsdom') | |
| var https = require('https') | |
| // Prepare array of song objects | |
| var list = fs.readFileSync('list.txt', 'utf8') |
| { | |
| "patterns": [ | |
| { | |
| "type": "path", | |
| "term": "/some/path\\$/gi", | |
| "transform": { | |
| "path": "/some/other/path/file.x", | |
| "name": "lorem", | |
| "type": "jpeg" | |
| } |
| { | |
| "patterns": [ | |
| { | |
| "type": "path", | |
| "term": "/some/path\\$/gi", | |
| "transform": { | |
| "folderPath": "/some/other/path", | |
| "name": "lorem", | |
| "fileType": ".jpeg" | |
| } |
A little late to the party but here's a widget you can calculate as many digits of π as you want (actually, do not try with huge parameters).
Update: It's now working concurrently with as many workers as cpu cores. So it gets faster if your computer has more cpus.
A Pen by Mustafa Enes on CodePen.
| BIN = ./node_modules/.bin | |
| DIST = ./dist | |
| SRC = ./src | |
| HTML_INPUT = $(SRC)/index.html | |
| HTML_OUTPUT = $(DIST)/index.html | |
| CSS_INPUT_DIR = $(SRC)/stylesheets | |
| CSS_INPUT = $(CSS_INPUT_DIR)/style.css | |
| CSS_OUTPUT_MIN_DIR = $(DIST) |
| var t = e => atob(e.split(':').map(e => String.fromCharCode(parseInt(e,2))).join('')) | |
| window[t('1011010:1101101:1010110:110000:1011001:110010:1100111:111101')](t('1100001:1001000:1010010:110000:1100011:1000100:1101111:1110110:1001100:110010:1001110:1110110:1011010:1000111:1010110:1110111:1011010:1010111:110100:1110101:1100001:1010111:111000:1110110:1100011:1000111:1000110:110010:1100010:1000111:111001:110010:1100011:110010:1110011:1110110:1100011:1000111:1010110:1110101:1001100:110001:1101000:1110100:1100001:1101100:1000010:1010000:1010010:1010001:111101:111101'), JSON.parse(t('1100101:1111001:1001010:1110100:1100010:110010:1010010:1101100:1001001:1101010:1101111:1101001:1100010:1101101:111000:1110100:1011001:110010:111001:1111001:1100011:1111001:1001010:111001'))) |
| function EventEmitter(options) { | |
| this._listeners = [] | |
| } | |
| EventEmitter.prototype.on = function(event, handler) { | |
| this._listeners[event] = this._listeners[event] || [] | |
| this._listeners[event].push(handler) | |
| } | |
| EventEmitter.prototype.off = function(event, handler) { |
| function EventEmitter(options) { | |
| this._listeners = {} | |
| } | |
| EventEmitter.prototype.on = function(event, handler) { | |
| this._listeners[event] = this._listeners[event] || [] | |
| this._listeners[event].push(handler) | |
| } | |
| EventEmitter.prototype.off = function(event, handler) { |
| function toBinary(plainText) { | |
| return plainText.split('').map(c => { | |
| return ('0'.repeat(BIT_COUNT) + c.charCodeAt(0).toString(2)).slice(-BIT_COUNT) | |
| }) | |
| } | |
| function generateKey(len) { | |
| return ' '.repeat(len * BIT_COUNT).split('').reduce(p => p + ~~(Math.random() * 2), '') | |
| } |