January 31, 2022

Wordle Solvers

Following on from a previous post, I wanted to explore what effect various kinds of strategies for solving Wordle have on how quickly you solve it. So I implemented Wordle in python, and then spent a while trying to find a good word list to use as a basis. Now, I know that you can inspect the Wordle page itself and find the list of words it uses for validating real words and the list of wordle answers, but I don’t want to use that list, so I made my own. I’ve put the code up at github. Read more

January 5, 2022

Wordle Letter Counts

In response to some discussion on twitter, I dug into how common different letters are at different positions in a word. Since the discussion was prompted by the popular word game Wordle the focus was on five letter words. My approach was to download a word list from the first google hit for word list download, and then throw python’s Counter module at it. from collections import Counter # Download a wordlist such as the one available here: # https://github.com/dwyl/english-words with open("../resources/words/words_alpha.txt") as d: wl = [x.strip() for x in d.readlines()] firsts = [x[0] for x in wl] fives = [x for x in wl if len(x) == 5] def top_letters(ctr, n=10): return ",".join([x[0].upper() for x in ctr.most_common(n)]) print("For all words in the list") print("Most common first letters") print(top_letters(Counter(firsts))) print("Most common all positions") print(top_letters(Counter("".join(wl)))) print("\n") print("For five letter words:") print("Top letters any position") print(top_letters(Counter("".join(fives)))) for i in range(5): print(f"Top letters in position {i}") letters = [x[i] for x in fives] print(top_letters(Counter(letters))) And here’s the result: Read more

April 25, 2021

Taskwarrior i3blocks

Here’s a niche little script I wrote. Are you in the intersection of the Venn diagram of people who use i3 window manager (or something similar such as regolith) and people who use the TaskWarrior to do list app? If so, you might be interested in this script that puts the description of currently active tasks in your i3bar. I’ve submitted a pull request to i3blocks-contrib, but there are a lot of PRs pending, so I don’t know how active the repo is. For now, anyway, the script is available on its own repository. Read more

April 3, 2021

A linker script for keeping configuration files synced

This post is mainly to test hugo’s code formatting capacities. I have two machines – a desktop PC and a laptop – that I like to keep in sync. I do this by keeping a git repo of my various configuration files called dotfiles which is backed up to a web server. Then, I just make symbolic links from all the places my programs are looking for their configs to the config files in the repo. So I push to that when I make changes, and fetch changes from the server when I need to propagate them to the other machine. Read more

© Seamus Bradley 2021–6

Powered by Hugo & Kiss.