View index.html
This file contains 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
<main> | |
<controls> | |
<div class="new-game">New Game</div> | |
<div>Moves <span class="moves">0</span> / <span class="max-moves">30</span></div> | |
</controls> | |
<board></board> | |
<colors></colors> | |
<controls> | |
<div>Skill <span class="skill">0</span></div> | |
<div><input type="range" class="level" value="10" min="3" max="10" /></div> |
View index.html
This file contains 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
<div id="keysleft"> | |
move: WASD | |
<br>hold/drop: E | |
<br>pause: F | |
<br>gravity: R | |
</div> | |
<div id="keysright"> | |
zoom: + - | |
<br>fire: click | |
<br>testing: T |
View index.html
This file contains 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
<svg height = '800' width = '1200'> | |
<g id="grid" stroke="#f2f2f2"> | |
<line x1="0" y1="0" x2="3000" y2="0" style="stroke-dasharray:1,58,1,0;stroke-width:3000;"/> | |
<line x1="0" y1="0" x2="0" y2="3000" style="stroke-dasharray:1,58,1,0;stroke-width:3000;"/> | |
</g> | |
</svg> | |
<br> | |
Controls: arrow keys |
View index.html
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
View mochainstance.mjs
This file contains 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
import Mocha from "mocha" | |
export default new Mocha() |
View context.js
This file contains 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
let context = {}; | |
context.createContext = function (fn) { | |
let name = "context" + Math.floor(Math.random() * 10000000); | |
Object.defineProperty(fn, "name", {value: name}); | |
let params = {}; | |
global[name] = params; | |
fn(params); | |
delete global[name]; | |
}; |
View pollard
This file contains 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
const makeG = n => x => (x ** 2 + 1) % n; | |
const gcd = (a, b) => (b === 0 ? a : gcd(b, a % b)); | |
const pollard = n => { | |
const g = makeG(n); | |
let x = 1; | |
let y = 2; |
View flatten.js
This file contains 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
const flatten = function flatten(array) { | |
const flattened = array.reduce( | |
function reducer(reduced, arrayItem) { | |
const arrayItemIsArray = Array.isArray(arrayItem); | |
if (arrayItemIsArray) return reduced.concat(flatten(arrayItem)); |
NewerOlder