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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/109/three.min.js"></script> | |
<style> | |
html, body { |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/109/three.min.js"></script> | |
<script src="./scripts/OrbitControls.js"></script> | |
<style> |
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 irange = (a, b) => R.range(a, b + 1); | |
const neighbourRange = x => irange(x - 1, x + 1); | |
const between = R.curry((a, b, x) => x >= a && x < b); | |
const cellExists = (x, y) => between(0, grid.length, y) && between(0, grid[0].length, x); | |
const getCell = R.curry((x, y, grid) => cellExists(x, y) ? grid[y][x] : 0); | |
const neighbourhood = (x, y) => R.xprod(neighbourRange(x), neighbourRange(y)); | |
const adjacent = R.curry((x, y) => R.reject(R.equals([x, y]), neighbourhood(x, y))); | |
const getCells = R.curry((cells, grid) => R.map(([x, y]) => getCell(x, y, grid), cells)); |
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
alias gc="git checkout" | |
alias gd="git diff" | |
alias gb="git branch" | |
alias gs="git status" |