This commit is contained in:
ryfrd 2026-03-18 20:32:25 +00:00
parent 6623ee03f6
commit 44c8324063
120 changed files with 22842 additions and 4673 deletions

View file

@ -1,40 +1,43 @@
<!doctype html>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="https://nonsense.dymc.win/favicon.ico">
<link id="stylesheet" rel="stylesheet" href="/css/light.css">
<html lang="en"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="http://localhost:1313/the-search-for-en-passant-checkmates/" />
<title>The search for en passant checkmates - James&#39; Blog</title>
<link rel="canonical" href="https://nonsense.dymc.win/the-search-for-en-passant-checkmates/" />
<title>The search for en passant checkmates</title>
<link rel="stylesheet" href="/css/style.css">
<script>
document.documentElement.setAttribute('data-theme', 'dark');
</script>
</head>
<body><header id="banner">
<nav class="navbar">
<body><header class="site-header">
<nav>
<a href="http://localhost:1313/" class="home">~</a>
<div class="nav-links">
<a href="https://nonsense.dymc.win/" class="home">🏠</a>
<a
href="/info/"
title="👋"
>👋</a
><a
href="/search/"
title="🔎"
>🔎</a
>
<button id="toggle-button" class="toggle-button" onclick="toggleTheme()">🌚</button>
<a href="/search">/</a>
</div>
</nav>
</header>
<main id="content">
<article>
<header id="post-header">
<h2>The search for en passant checkmates</h2>
<div>
<p>October 26, 2022</p>
<article class="post">
<header>
<h1>The search for en passant checkmates</h1>
<time>Oct 26, 2022</time>
<div class="tags">
<a href="/tags/chess">chess</a>
<a href="/tags/python">python</a>
</div>
</header><p>The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.</p>
</header>
<div class="content">
<p>The chess.com API gives you access to a crazy amount of data on games played on the site. Armed with the knowledge that this data was at my fingertips, I set out to do what any sane person would do: find en passant checkmates. For those not in the know, en passant check mate is kind of the king of moves in chess meme circles. So some sort of python script that identified en passant check mates that occured on the site would be of great value to me.</p>
<p>First things first, I would need a method of grabbing lots of games from the api. This would be achieved by looking at players on the site and searching their game archives. As I couldn&rsquo;t think of any obvious way to get completely random players on the site, I used the API&rsquo;s lists of all titled players (GM, IM, WIM, etc.) on the site. This is what I came up with -&gt;</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"> <span class="k">def</span> <span class="nf">get_archive_urls</span><span class="p">(</span><span class="n">titled_urls</span><span class="p">):</span>
</span></span><span class="line"><span class="cl"> <span class="n">players</span> <span class="o">=</span> <span class="p">[]</span>
@ -69,16 +72,16 @@
</span></span><span class="line"><span class="cl"> <span class="p">]))</span>
</span></span></code></pre></div><p>We get a very long list of json objects (is that the right phrase? um). Each corresponding to one of games played by GMs and WGMs on chess.com during May of 2022. Come back next time to see what we can do with this very long list. Here&rsquo;s a taster of what the list looks like printed to a terminal - lots of possiblities.</p>
<p><img src="/image/output.webp" alt="image alt text"></p>
</article>
</main>
<footer id="footer">
<small>
made with <a href="https://gohugo.io">hugo</a>
</small>
<script src="/js/search.js"></script>
<script src="/js/toggle.js"></script>
</footer>
</body>
</div>
</article>
</main><footer class="site-footer">
<small>
<a href="/index.xml">RSS</a>
·
<a href="https://gohugo.io">Hugo</a>
</small>
<script src="/js/script.js"></script>
</footer>
</body>
</html>