-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanagram-finder.html
More file actions
58 lines (54 loc) · 3.09 KB
/
anagram-finder.html
File metadata and controls
58 lines (54 loc) · 3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2022-W11-4 02:13 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Anagram Finder</title>
<meta name="author" content="Inanna" />
<meta name="description" content="A simple program to find anagrams." />
<meta name="generator" content="Org Mode" />
<link href="/site.css" rel="stylesheet" type="text/css" /><link href="images/website-icon.png" rel="icon" />
</head>
<body>
<div id="preamble" class="status">
<div><a href="/index.html"><img alt="An abstract logo representing a series of three assembly line stamping machines with the words CONS, DEV, and embalzoned in white on each machine." id="site-logo" src="/images/website-logo.png" /></a></div>
</div>
<div id="content" class="content">
<h1 class="title">Anagram Finder</h1>
<div id="table-of-contents" role="doc-toc">
<h2>Table of Contents</h2>
<div id="text-table-of-contents" role="doc-toc">
<ul>
<li><a href="#org43388e9">Introduction</a></li>
<li><a href="#org7da555a">Code</a></li>
</ul>
</div>
</div>
<div id="outline-container-org43388e9" class="outline-2">
<h2 id="org43388e9">Introduction</h2>
</div>
<div id="outline-container-org7da555a" class="outline-2">
<h2 id="org7da555a">Code</h2>
<div class="outline-text-2" id="text-org7da555a">
<p>
Here we do a few things, we first load the list of words as a hash table so checking if a word is contained in it is easy.
</p>
<div class="org-src-container">
<pre class="src src-clojure"><span style="color: #494949;">(</span><span style="color: #E53935; font-style: italic;">ns</span> <span style="color: #E53935;">anagrams</span>
<span style="color: #bbb;">(</span><span style="color: #E53935;">:require</span> <span style="color: #494949;">[</span>clojure.math.combinations <span style="color: #E53935;">:as</span> combo<span style="color: #494949;">]</span><span style="color: #bbb;">)</span><span style="color: #494949;">)</span>
<span style="color: #494949;">(</span><span style="color: #E53935;">combo</span>/permutations s<span style="color: #494949;">)</span>
<span style="color: #494949;">(</span><span style="color: #E53935; font-style: italic;">defn</span> <span style="font-weight: bold; font-style: italic;">find-anagram</span> <span style="color: #bbb;">[</span>s<span style="color: #bbb;">]</span>
<span style="color: #494949;">)</span>
</pre>
</div>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="date">Last Modified: 2021-W49-5 21:49</p><p class="creator">Generated Using: <a href="https://www.gnu.org/software/emacs/">Emacs</a> 27.2 (<a href="https://orgmode.org">Org</a> mode 9.4.6)</p><p class="license">Except where otherwise noted content on <a href="https://cons.dev">cons.dev</a> is licensed under a <a href="https://creativecommons.org/licenses/by-sa/4.0/" rel="license">Creative Commons Attribution-ShareAlike 4.0 International License</a>.</p>
</div>
</body>
</html>