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> | |
<title>Happy π Day 2018</title> | |
</head> | |
<body> | |
<header> | |
<div>Total pins = <span id="total-pins"></span></div> | |
<div>Crossing pins = <span id="cross-pins"></span></div> |
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
#!/usr/bin/env python | |
import os.path | |
import struct | |
def compile_line(line, i): | |
no_comment = line.split('#', 1)[0] | |
hex_code = no_comment.strip().replace(' ', '') | |
if len(hex_code) % 2 != 0: | |
raise Exception("%d: hex characters must be in pairs\n%s" % (i, line)) |
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
/* | |
* Happy PI Day '17 | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <time.h> | |
const int COUNT = 1000000; |