Skip to content

Instantly share code, notes, and snippets.

View ndonolli's full-sized avatar

Nathan Donolli ndonolli

View GitHub Profile
@ndonolli
ndonolli / index.html
Last active June 24, 2016 19:02 — forked from anonymous/index.html
Variables[A primer on variables]// source http://jsbin.com/zifara
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[A primer on variables]">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Variables</title>
</head>
<body>
<!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">
<!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">
<!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">
<!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">
<!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">
<!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">
@ndonolli
ndonolli / remove-at.clj
Created April 3, 2019 16:24
Remove nth element from a list or vector
(defn remove-at [n xs]
(let [removed (flatten (conj (drop (+ n 1) xs)(take n xs)))]
(if (vector? xs)
(vec removed)
removed)))
; Write a function to determine if two words are anagrams.
(defn is-anagram [target src]
(if (string? target)
(if (= target src)
false
(is-anagram (frequencies target) src))
(= target (frequencies src))))
; Given a dictionary of words (such as this one), find all of the anagrams for a target word.
; Assumption: dictionary of words is a collection
(defn check-path-win
"Checks a path for a win"
[s]
(if (apply = s)
(first s)
nil))
(defn check-win-direction
"Checks a sequence of paths in a particular direction for a win"
[dir-seq]