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
function classExists(className, root = null) { | |
var pattern = new RegExp('\\.' + className + '\\b'), found = false | |
var sheets = root; | |
if (root === null) { | |
sheets = document.styleSheets; | |
} | |
try { | |
for (var i=0; i<sheets.length; i++) { | |
var ss = sheets[i]; |
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
<html lang="en"> | |
<head> | |
<title>Brdige Scoring Drills</title> | |
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script> | |
<style type="text/css"> | |
.hidden { | |
display: none; | |
} |
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
type Vertex = [number,number]; | |
type Hex = Vertex[]; | |
const narrow = true; // Change this to toggle between the base and narrow versions | |
const size = 14; // board height; width = height - 1 | |
const baseHex: Hex = []; | |
const s32 = Math.sqrt(3) / 2; | |
const rad = 1 / Math.sqrt(3); | |
for (let i = 0; i < 6; i++) { |