Skip to content
    • About
    • About

Steve Cooper's Personal Blog

  • Solo TTRPGs as an Apprenticeship in Games Mastering

    October 11th, 2026

    I’ve been thinking about whether solo TTRPGs might be a good way to learn to be a better games master. Not just as a way of playing games on my own, but as a kind of apprenticeship, where I can practice the creative and improvisational skills that a GM needs, without having to run an actual game for other people.

    The analogy that comes to mind is an assisted pull-up machine at the gym. It supports some of your weight so you can do an exercise you’re not yet strong enough to manage on your own. As you get stronger, you reduce the assistance. I wonder whether solo games, together with the right sorts of prompts and random tables, could do something similar for my improvisational muscles.

    I think this might help with a couple of problems I have with games mastering.

    My two problems

    The first is that I simply don’t have much experience inventing the sorts of things that go into a game. NPCs, locations, magic items, clues, plots, twists, complications and so on. I haven’t really spent much time doing this, and I don’t have much confidence in my ability to come up with them.

    I don’t think these things necessarily need to be very complicated. I could just sit down and write a list of twelve NPCs, for example. That would be a perfectly useful bit of practice. But I haven’t done enough of this kind of thing to feel comfortable with it.

    I suspect that a good GM has a fairly large stock of ideas and patterns they can draw on without much effort. When the players unexpectedly visit a shop, they can invent a shopkeeper. When something needs to go wrong, they can think of a complication. The ideas don’t have to be brilliant or original. They just have to be reasonable, interesting enough, and quick enough to keep the game moving.

    I’d like to get to the point where I can do that.

    My second problem is probably more serious. I have a massive tendency to overthink and overcomplicate things.

    I’ll sit down to write a character or a location, get one or two sentences onto the page, and then immediately start thinking about how to organise everything. Perhaps I need a database, or a system for classifying ideas, or a program for generating and evaluating them. Before long I’m researching tools on the internet or vibe coding a new application.

    And of course I’m no longer doing the thing I originally sat down to do.

    I think this is partly because I’m much more comfortable designing systems than I am inventing fictional material. So when the creative work gets uncomfortable, I retreat into something I know how to do.

    The trouble is that I can spend hours doing this without producing much of anything. What I probably need is to trust myself to write something down on a piece of paper, then write the next thing, and keep going.

    Why solo games might help

    One thing I noticed while trying out All Night Breakfast at the Midnight Owl was that I felt a really pleasing sense of calm.

    I was just sitting there, following the game’s procedures, writing things down and gradually creating a little fictional world. I wasn’t trying to design a system or work out the best possible way to organise my notes. I was simply doing the creative work, one thing after another.

    And I found that I was actually rather better at inventing details than I’d expected.

    That’s encouraging. It suggests that perhaps I’m not especially bad at this sort of creativity. Maybe I just need to put myself in situations where I can get on with it, without constantly questioning what I’m doing or wandering off into some other project.

    Solo TTRPGs seem particularly good for this because they give you a sequence of small creative tasks. Something happens, you have to describe it or decide what it means, you write it down, and then you move on.

    There’s a structure that keeps you going, but you still have to do the imaginative work yourself.

    That feels like exactly the sort of assisted exercise I’m looking for.

    How much help do I actually need?

    Another thing I’ve noticed is that I don’t necessarily need very much assistance to come up with plausible details.

    For example, if I’m trying to invent characters in a town, having a list of names and perhaps a list of professions makes the whole thing much easier. Similarly, a list of types of location might be enough to get me started describing a town. Once I’ve got a few initial details, the rest often comes quite naturally.

    This makes me wonder what the minimum useful collection of lists might be for different creative tasks.

    Names, professions, locations, clues, objects, relationships, conflicts, complications, and so on.

    Perhaps there are only a relatively small number of categories I need to cover before I can do an acceptable amount of improvisation.

    I also think there are two rather different kinds of assistance worth distinguishing.

    The first is help before creating something. This is about warming up the creative landscape. A few prompts, trigger words or random suggestions can open up possibilities and give me things to think about.

    This kind of assistance is particularly useful when there’s no great pressure to produce an immediate answer. When I’m playing a solo TTRPG, preparing a session, or writing a new game setting, I can afford to explore possibilities. A random prompt might take me somewhere unexpected, and that’s fine. I have time to think about it.

    The second kind is help during play, when something uncertain or unexpected happens at the table and I need to respond.

    This is a different problem. Here, I don’t necessarily want to open up a huge range of possibilities and spend ages thinking about them. I want something that helps me pivot, make a decision, introduce a surprise or discover what happens next.

    These are the risky moments when a game can slow down because I can’t think of anything, or when I might fall back on something clichéd and boring simply because it’s the first idea that comes to mind.

    A useful oracle or random table could give me just enough of a nudge to get past that moment and keep things moving.

    Both kinds of assistance seem valuable, but they’re doing different jobs. One helps me explore and create when I have time. The other helps me respond and improvise when I don’t.

    And presumably, as I become more experienced, I’ll need to consult both kinds of tools less often.

    Procedures and generators

    Something else struck me while playing the solo game, this time about how the book is organised.

    When you’re following a procedure, the instructions can refer you to a table somewhere else in the book. So a procedure for creating an NPC might tell you to look at the list of names on page 27.

    That’s a pretty obvious bit of book design, but I think there’s something interesting behind it.

    If you have a reasonably fixed collection of procedures that you’re likely to follow, and each one tells you where to find the tables it needs, then you have a fairly convenient way of organising all this creative assistance.

    It suggests that there are really two distinct things here: procedures and generators.

    A generator is a list or random table that provides some detail. A name, a profession, a type of location, a valuable object, a source of conflict, or whatever.

    A procedure is a description of something you’re trying to create, which might use several of those generators.

    For example, I might have a procedure for generating an NPC. But I could also have a procedure for generating a little plot or situation.

    That might involve creating two NPCs, putting them in a location, giving them some sort of relationship, establishing a conflict between them, and deciding on an object they’re both contending over.

    I’ve now got the beginnings of a playable situation rather than just a collection of disconnected characters and objects.

    And the procedure could refer out to the name generator, location generator, relationship generator, conflict generator, valuable object generator, and so on.

    The interesting thing is that the same generators could be used by lots of different procedures.

    So there’s almost a matrix of procedures and generators. The procedures describe the creative acts I want to perform, and the generators provide the raw material.

    That seems like a useful way of organising things, both for a game book and for learning to GM.

    A syllabus for games mastering

    This is where the apprenticeship idea starts to get particularly interesting.

    I wonder whether there’s a relatively fixed set of procedures that a GM or adventure writer needs to be able to perform.

    Creating an NPC, describing a location, inventing a conflict, introducing a complication, revealing a clue, creating a situation, and so on.

    Some of these procedures will be quite small. Others will involve combining several smaller procedures.

    But if I could identify them, I might have the beginnings of a syllabus for learning to GM.

    Rather than trying to become good at the rather vague activity of “games mastering”, I could practise particular skills.

    I could spend some time generating NPCs. Then practise creating locations. Then create conflicts between characters. Then combine those things into situations. Eventually I could work up to scenarios and adventures.

    The written material needed to support this might be simple. There are basically two forms:

    1. Descriptions of procedures — what am I trying to create, and what steps do I follow?
    2. Generators — lists of options and random tables that supply the details I need.

    That’s potentially quite a manageable system.

    And it also gives me a way to think about what an experienced GM actually knows.

    What does an experienced GM have in their head?

    I suspect that an experienced GM has internalised quite a lot of these procedures.

    They don’t need to look up how to create a complication or invent a character with a motivation. They’ve done it often enough that the process is fairly automatic.

    They’ve also internalised a lot of the material that might otherwise appear in generators. They’ve got a stock of names, professions, character types, locations, conflicts, motivations and other ideas that they can call upon.

    So perhaps an experienced GM is doing much the same thing as a beginner with a book full of procedures and tables, except that more of it is happening in their head.

    That would fit rather nicely with the assisted pull-up analogy. The external procedures and generators are there to support me while I’m learning. As I get more experienced, I gradually internalise them and need less help.

    It also makes me think about GM style.

    Perhaps a GM’s style is partly a matter of which procedures they tend to use and what sorts of things they habitually invent.

    One GM might frequently introduce interpersonal conflicts and complicated relationships. Another might tend towards mysteries, strange locations or unexpected dangers.

    And the procedures themselves say something about the kind of game being played. A game about investigation presumably has a different collection of commonly used procedures from a game about dungeon exploration or political intrigue.

    So maybe a GM’s style is partly the repertoire of procedures they return to, together with the kinds of details they tend to generate when they’re improvising.

    I rather like that idea.

    Is a whole campaign just a collection of nested procedures?

    Following this line of thought, I wonder whether running an entire campaign is really just a series of nested procedures.

    At the top level, there are procedures for creating and developing a campaign. Within that, procedures for creating adventures or scenarios. Within those, procedures for creating situations, characters, locations and conflicts.

    And then, during play, there are smaller procedures for describing things, responding to player decisions, introducing complications, resolving uncertainty, and so on.

    Perhaps the apparently enormous job of running a campaign is really a hierarchy of smaller, more manageable activities.

    And perhaps becoming an experienced GM is largely a matter of learning and practising these activities over a couple of years, until you can combine them without having to think very hard about the individual steps.

    I find that a rather hopeful idea, because it makes the whole problem seem much more tractable.

    Why I keep going round in circles

    I think one of my problems at the moment is that I’m not really confident at any of these levels.

    If I’m trying to do something small, like creating a character or a location, I can easily get distracted by questions about mechanics, scenarios or campaign design.

    Instead of finishing the little thing I’m working on, I jump up to a larger problem.

    But the larger problems are too big and complicated for me to get a grip on, so I bounce off them and go somewhere else.

    And because I’m comfortable with programming and system design, those are often the places I end up.

    The result is that I’m constantly moving between different levels of abstraction, never staying with one thing long enough to get much experience of actually doing it.

    I spend a lot of time in churn rather than production.

    I suspect this is also why my lack of confidence persists. I’m not completing enough small creative tasks to discover that I can actually do them.

    And that’s perhaps the most useful thing about thinking of GMing as an apprenticeship.

    If the skill can be broken down into procedures, then I can practise one procedure at a time. I don’t need to worry about how to run a whole campaign when I’m supposed to be creating an NPC. I just need to create the NPC, write it down, and move on.

    I can repeat the exercise, get better at it, and then start combining it with other procedures.

    Where this leaves me

    I don’t yet know what the complete set of procedures would look like, or how many generators would be needed to support them.

    But I like the possibility that there might be a reasonably finite collection of things to learn, rather than one enormous, mysterious talent called “being a good GM”.

    I also like the idea that solo TTRPGs could provide a pleasant, relatively unpressured environment for practising those things. They give me something to do, a reason to invent details, and enough structure to stop me getting lost.

    The experience with All Night Breakfast at the Midnight Owl was encouraging because I actually enjoyed the process. I felt calm, I was creating things, and I was better at it than I’d expected.

    I’d like to find a way to build on that.

    Perhaps the trick is not to design the perfect system for creating adventures, but to identify a small collection of useful procedures, give myself just enough supporting material, and practise them.

    And, importantly, to resist the temptation to write a program to manage the whole thing.

    Just sit down with a piece of paper, invent something, write it down, and then invent the next thing.

  • [RPGS] Narrative vs Simulationist – a cheap definition

    October 8th, 2026

    Ok, more to remember than to teach…

    Narrative vs Simulationist games are really a collection of mechanics, and its mechanics that are narrative or simulationist.

    For example, you could have a highly simulationist game — “your strength means you can carry Xlbs; your intelligence means you know N languages.” — while you also have a narrativist mechanic like “spend a fate point to get a reroll.”

    For me, a key thing I think I see in story games vs narrativist games is this;

    • in narrative games the mechanics give you an outcome, and let you dictate the means. In simulations you roll for the means, and the outcome follows.

    For example; a narrative game might ask you to do this in turn;

    • roll to see if you win a combat (the dramatic outcome)
    • invite you to dictate how your character achieves it

    While a simulationist game does it the other way round

    • roll to move silently
    • roll for backstab damage
    • if you do more damage than the person has, then you have won the combat

    As worked examples;

    • in Blades in the Dark, you might roll Prowl to assassinate a guard; but we roll first. Then we agree as players that, yes, Carter has killed the unsuspecting guard. So now the GM says “ok, tell us how he does it.” The invitation is ‘safe’ because we know the little sandpit that Carter’s player is allowed to improvise in.
    • In AD&D 1e, the guard has 7 hit points; Carter rolls ‘move silently’ and passes; then he gets +4 on hit attack roll and does triple damage – 3d4 – and rolls 9. The guard is reduced to below zero, and dies

    Just bear in mind that trend;

    • narrativist: roll for discrete outcomes, then improvise detail to match
    • simulationist: roll for numbers or grades of success, then apply to the world to find out what happens.

    Bonus; ‘rules light’ games in this light.

    So a rules-light narrative game is one with really simple mechanics for determining the next dramatic outcome. “roll 2d6 – 6 or less, you fail, 7-9 it’s complicated; 10+ you win” Think Powered by The Apocalypse or Carved from Brindlewood. You cut straight to the dramatic questions.

    A rules-light simulationist game is one with really simple mechanics for determining the effect of actions. The odd-likes (Into the Odd; Cairn; etc) have very simple mechanics for hits, damage, wounds, etc – allowing fast, effect-first play.

  • Protected: Auto-Sapkowski!

    This content is password-protected. To view it, please enter the password below.

  • Bookbinding Course with Anachronalia, Leeds

    May 5th, 2023

    Recently, I had the pleasure of attending Linette’s exceptional bookbinding course. In just a single day, we were able to cover an impressive amount of skills, practical experience, and historical knowledge that felt like a week’s worth of content!

    As a beginner to bookbinding and not exactly an experienced crafter, I was simply looking to bind some of my own writings. Linette’s a great teacher, and she made sure her instruction was tailored to the experience level of the group.

    Throughout the course, we learned to create three distinct books, including two softcovers and one hardback. Everything we needed was provided, and Linette patiently guided us through the basics before diving into the hands-on activities. The first two books were a breeze to make, and I felt confident enough to create my own at home the very next day.

    The hardback book required more effort, but Linette’s step-by-step guidance made the process enjoyable and rewarding. Linette keeps materials in a lot of designs and colours, and everyone was able to select something personal and walk away with a unique creation. We were all delighted with the results. I now feel equipped to tackle making hardbacks at home, albeit with a few additional materials.

    What set this course apart was the rich historical background Linette provided on construction techniques. I feel like I’ve gained an understanding of bookbinding’s history, and that then has given me the ability to ‘read’ a book and discern its creation process. This newfound knowledge has made navigating tutorials, websites, and online shops much more easily — I can now confidently ‘talk book.’

    I’d wholeheartedly recommend Linette’s bookbinding course to anyone interested in learning the craft. The experience was both practical and enlightening. I couldn’t have asked for a better introduction to the world of bookbinding.

    Go check out her site…

    Welcome to Anachronalia
  • My new development blog

    August 24th, 2012

    I’ve just started a new software development blog at SteveDrivenDevelopment.com. If you care about things like OO software, unit testing, and other similar subjects, why not come over and add me to your blog roll?

  • Fun with Graph Theory

    September 9th, 2011

    I asked a question in twitter about graph theory the other day. Unsurprisingly, it was tricky to convey what I wanted to know in such a short span. So this explains what i was wondering in more depth.

    I’ve got a problem involving graph layouts (think dot and graphviz) I want to write a GUI program that lets the user draw directed graphs interactively. That is, they start with a single node. Then, to modify that graph, there are five basic operations:

    – add a node above: that is, a node _A_ becomes the graph _B_ -> _A_
    – add a graph below: _A_ -> _B_
    – add an edge between two nodes
    – delete an edge
    – delete a node, and all connecting edges

    And what I’d like to know is; to keep the UI responsive, can I precalculate the positions of every possible graph ahead of time? When the user makes a change, I can refer to the precalculated positions and keep the UI experience really fast.

    This depends on how many possible nodes there are. If I am only ever going to see, say, 500,000 possible layouts, it is possible to just spend a couple of days chugging through all the possible configurations and saving them in a database.

    Without any more limits, this is impossible — there are an infinite number of graphs. But I think I can make reasonable guesses about the types of graph I’m likely to see in my app. For instance;

    – the graph is always connected
    – no two nodes have a duplicate edge
    – the graph has no cycles
    – Nodes generally won’t have more than about five incoming nodes and five outgoing nodes
    – A graph probably won’t have more than about 100 nodes in it

    So here’s how I formulated the problem;

    Given a directed acyclic graph with _N_ nodes, where no node has more than _E_ total incoming and outgoing nodes, how many possible graphs are there?

  • Chess Problem – eh?

    August 24th, 2011

    I’m struggling to see why a chess problem has the answer it does. Does anyone see why Nf6 is the right answer here? Looks crazy to me. Surely the knight can be taken without consequence by g7 or Nf5?

    Pgn is:

    [Event “”]
    [Site “”]
    [Date “2011.08.24”]
    [Round “”]
    [White “Player 1”]
    [Black “Player 2”]
    [Result “*”]
    [ECO “”]
    [SetUp “1”]
    [FEN “3r4/2rN1ppk/4p3/1Rp2n1n/2P2P1p/1P3P2/5B1P/3R1K2 w – -“]

    1. Nf6+ * { isn’t the knight here simply undefended? }

    20110824-133818.jpg

    20110824-133840.jpg

  • Mother’s Day Flash Fiction: Thorsday Teatime

    March 31st, 2011

    Jord stood at the gates of Odin’s hall, and rapped the knuckles of her callused hands against the ancient black-oak door. “Odin! Odin! Open your gates, One-eye! I have come to kill your son!”

    Through the gates, she could hear the sound of a feast. Deep inside the hall, a bard’s rich voice would sing a line, and a hundred hundred voices would roar a response. Nearer the door, she heard someone vomit.

    “Do you hear me, old man? I have come for your son! I gave him life, and I shall take it back! Bring me Thor, that I might kill him!” She took up a stone from the ground, and brought it hard against the door. The sound reverberated into the hall. “Bring!” Bash. “Me!” Bash. “My!” Bash. “Son!”

    The bard had stopped singing, and the sounds of laughter from inside had ceased. Jord could hear footsteps, then the doors of Valhalla, opened only for the souls of the battle-fallen, swung open. Inside, a great brown-haired Viking, fur-clad and looking for all the world like a bear, regarded her. Ten thousand pairs of eyes watched them both.

    “Woman!” he bellowed. “This is Valhalla! The hall of Odin, Great and Grey-eyed Gallows-Lord!” Behind him, a chorus of drunken cheers.

    “And here are the greatest bloodletters, beserkers, bonesplitters and throat-slitters who ever lived! Drinking bright mead and eagerly waiting for the Fenris-wolf and Ragnarok.” Behind him the great cheer swelled again.

    “Inside also is Thor, Strong and Stalwart Sky-King! Far-famed Fighter in Battle!” To the jeers and cheers was added the thumping of tables and smacking of shields. The herald continued, heartened by the noise.

    “Thor, the Friend of Fat-Feasting Ravens! Thor, the Spiller of Seas of Slaughter-dew! Thor, The Hard Hammer-Handed Warrior!” He took a long breath. “Who are _you_, that comes here, to this great host, and challenges the Lord of the Leaping Lightning and the Thunder-din?”

    “I’m his mum.”

    “… Ah.”

    Jord pushed the man aside, and strode into the hall. Her eyes peered into and through the smoke, past the long trestles bursting with food, past the many thousands of men, battle-proved and strong, who sat at the tables. Each one regarded the small woman in silence. She ignored them and walked straight down the central aisle towards the top table.

    Through the haze she could make out the great fire pit, over which was roasting the great cosmic boar Saehrimnir, cooked every night and returned to life every morning. She walked past it, looking on towards the great central table where the king of the gods sat with his favoured retinue.

    As she passed the great cooking fire, and its brightness was at her back, she could see Odin, the god-king, sitting at the centre of his table. In one hand he held a great ham hock; in the other, a jewelled eating-knife. He was old, and scarred, and an eyepatch covered his vacant eye-socket. His hair was grey and white and black and wiry. On his right hand side sat Thor, the great blond god who could strike a man down with his mighty hammer, Mjolnir, or with lightning from the sky itself. The huge god sat there, with something like a smirk on his face. Behind that smile, though, Jord could see the slightest glimmer of fear. He knew he had done something, but he did not know what.

    “Thor, my miserable son,” Jord said, “do you know what day of the week it is?”

    He regarded her for a moment. “Mother, it is my day — Thorsday.”

    “That’s right. And the day before?”

    “Wodin’s day. In honour of my father.”

    “Keep going. The days before that?”

    “Tyr’s day, after Tyr One-Handed, who struggled with the great wolf Fenrir.” Jord sat watching him, waiting. “And Mani’s day before that, and then the day of Sunne, goddess of the Sun.”

    “The first Sunday of spring…” she said, waiting for him to continue. Thor wrinkled his wide brows in thought. For long seconds he pondered.

    “Mothering Sunday! By Freya’s freckly buttocks! I forgot!” His confusion changed to realisation, then near-panic. His voice dropped low, so that only those at the table could hear. “I’ll make it up to you,” he said. “I shall travel to the netherworld Svartalfaheim, and steal for you a great black pearl from the dwarves!”

    “Not good enough.”

    “I shall have my daughter, Thrud, weave you lace from threads of pure moonlight!”

    “Not good enough.”

    “I shall go to icy Niflheim, and wrestle from Hel her great cloak made from night and stars. ”

    “Not good enough.”

    “I shall… I…”

    “There’s only one way you’re going to make up for it.”

    Thor looked at her with a suspicious eye. “And… And how is that?”

    She leaned forward, mouth next to Thor’s ear, and whispered “Give me a cuddle.”

    Thor looked at her then, aghast, then at the horde of Odin, ten thousand warriors looking to their role model, waiting expectantly for the thunder-god’s response to the unknown request.

    What else could he do? He gave his mum a hug.

  • VB.NET and Python equivalence

    November 10th, 2010

    A [recent post on Hacker News](http://news.ycombinator.com/item?id=1885594) made me wonder if **<inflammatory>Python is just VB.NET without ‘End If’. </inflammatory>**

    I thought I’d try to translate Peter Norvig’s masterful spellchecker program in Python into VB.NET 2008. Could his beautiful little program be converted line-by-line into VB? The answer is *yes.*

    Here’s the [original program](http://norvig.com/spell-correct.html);

    import re, collections

    def words(text): return re.findall(‘[a-z]+’, text.lower())

    def train(features):
    model = collections.defaultdict(lambda: 1)
    for f in features:
    model[f] += 1
    return model

    NWORDS = train(words(file(‘big.txt’).read()))

    alphabet = ‘abcdefghijklmnopqrstuvwxyz’

    def edits1(word):
    splits = [(word[:i], word[i:]) for i in range(len(word) + 1)]
    deletes = [a + b[1:] for a, b in splits if b]
    transposes = [a + b[1] + b[0] + b[2:] for a, b in splits if len(b)>1]
    replaces = [a + c + b[1:] for a, b in splits for c in alphabet if b]
    inserts = [a + c + b for a, b in splits for c in alphabet]
    return set(deletes + transposes + replaces + inserts)

    def known_edits2(word):
    return set(e2 for e1 in edits1(word) for e2 in edits1(e1) if e2 in NWORDS)

    def known(words): return set(w for w in words if w in NWORDS)

    def correct(word):
    candidates = known([word]) or known(edits1(word)) or known_edits2(word) or [word]
    return max(candidates, key=NWORDS.get)

    And here’s the equivalent VB;

    Option Strict Off
    Imports System.Text.RegularExpressions
    Imports System.Collections.Generic

    Module NorvigSpellChecker

    Dim NWORDS

    Dim alphabet As String = “abcdefghijklmnopqrstuvwxyz”

    Function words(ByVal text)
    Return From match In Regex.Matches(text.ToLower(), “[a-z]+”) Select match.Value
    End Function

    Function train(ByVal features)
    Dim model = New DefaultDict(Function() 1)
    For Each f In features
    model(f) += 1
    Next
    Return model
    End Function

    Function edits1(ByVal word) As IEnumerable(Of Object)
    Dim splits = From i In Enumerable.Range(0, len(word)) Let a = word.Substring(0, i), b = word.Substring(i) Select a, b
    Dim deletes = From split In splits Where ifs(split.b) Select split.a + split.b.Substring(1)
    Dim transposes = From split In splits Where len(split.b) > 1 Select split.a + split.b.Substring(1, 1) + split.b.Substring(0, 1) + split.b.Substring(2)
    Dim replaces = From split In splits From c In alphabet Where ifs(split.b) Select split.a + c + split.b.Substring(1)
    Dim inserts = From split In splits From c In alphabet Select split.a + c + split.b
    Return deletes.Union(transposes).Union(replaces).Union(inserts).Distinct()
    End Function

    Function known_edits2(ByVal word)
    Return edits1(word).SelectMany(Function(e1) edits1(e1)).Distinct().Where(Function(e) NWORDS.ContainsKey(e))
    End Function

    Function known(ByVal words As IEnumerable)
    Return From w In words Where NWORDS.ContainsKey(w) Select w
    End Function

    Function correct(ByVal word)
    Dim candidates = ORR(Function() known(New String() {word}), Function() known(edits1(word)), Function() known_edits2(word), Function() New String() {word})
    Return candidates.OrderBy(Function(candidate) NWORDS(candidate)).FirstOrDefault()
    End Function

    End Module

    Because I needed to define some python-equivalents, like the `len(string)` function, I ended up writing a bit more code, just to try to get a more exact match. Also, LINQ expressions need to know that certain things are enumerable, so I needed to litter a few type declarations through the code; about half a dozen. But overall I’m happy with the result. Take off the block terminators — ‘End Function’, ‘Next’, and ‘End Module’ — and you end up with a line-perfect equivalent.

    Full source code [on github](https://github.com/stevecooperorg/Norvig-Spelling-Corrector-in-VB.NET/blob/master/NorvigSpellChecker.vb)

  • Quick phone topup hack

    October 14th, 2010

    I have discovered a neat little hack for topping up you mobile on pay and go. Most companies use a fixed menu system. If your phone allows you to store phone numbers including hashes and pauses, you can create a contact that navigates the menu system like a robot rat. Here is the phone number you use on 02 to top up by £15;

    44 44 ,#,1,#,1,#,#,9876#,543#,15#

    You’ll need to swap ‘9876’ with the last digits of your debit card, and ‘543’ with the security code on the back. 

    If that’s a useful trick and you use another mobile provider or phone, feel free to post your own patterns in the comments. 

1 2 3 … 18
Next Page→

Create a free website or blog at WordPress.com.

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
Loading Comments...
  • Subscribe Subscribed
    Steve Cooper's Personal Blog

    Have a WordPress.com account? Log in now.

  • Steve Cooper's Personal Blog
    View site in Reader
    Manage subscriptionsSign upLog in
    Report this content
    Collapse this bar