Skip to content

Instantly share code, notes, and snippets.

View zachauten's full-sized avatar
🐶
Pair programming with Hazel

Zach zachauten

🐶
Pair programming with Hazel
View GitHub Profile
// https://en.wikipedia.org/wiki/Quine_(computing)#Constructive_quines
let q = String.fromCharCode(34);
let code = [
"// https://en.wikipedia.org/wiki/Quine_(computing)#Constructive_quines",
"let q = String.fromCharCode(34);",
"let code = [",
"];",
"for (let i = 0; i < 3; i++) {",
" console.log(code[i]);",
"}",
const express = require('express');
const http = require('http');
const axios = require('axios');
describe('express', () => {
const port = 8888;
let server;
beforeAll(done => {
@zachauten
zachauten / monty.py
Created January 12, 2019 15:48
Monty Hall Problem Sim
#! /usr/local/bin/python
import random
# return the door monty chooses to open. can't be the prize door or player's first pick
def montys_pick(prize_door, first_pick):
doors = [1, 2, 3]
# if the prize is behind the player's first pick, monty randomly chooses one of the other 2 doors to open.
if prize_door == first_pick:
doors.remove(prize_door)
return doors[random.randint(0,1)]