dv,r'k

2025-03-22

import random
random.seed(0)

text = r'''
There are a lot of great reasons not to use Dvorak. Here's a terrible one: your
typos will look *absolutely psychotic* to anyone, staring at their keyboard,
trying to imagine how it was possible to screw up typing that badly.
'''


dvorak = [ [ "1234567890[]", "',.pyfgcrl/=", "aoeuidhtns-", ";qjkxbmwvz" ],
           [ "!@#$%^&*(){}", '"<>PYFGCRL?+', "AOEUIDHTNS_", ":QJKXBMWVZ" ] ]

lookup = {}
for shift, layer in enumerate(dvorak):
    for i, row in enumerate(layer):
        for j, c in enumerate(row):
            lookup[c] = (shift, i, j)

for p in [0.0, 0.04, 0.12, 0.36]:
    for c in text:
        if c not in lookup:
            print(c, end='')
            continue
        shift, i, j = lookup[c]
        if random.random() < p:
            j += random.choice([-1, 1])
        if random.random() < p / 3:
            i += random.choice([-1, 1])
        i = max(0, min(i, len(dvorak[shift]) - 1))
        j = max(0, min(j, len(dvorak[shift][i]) - 1))
        print(dvorak[shift][i][j], end='')

There are a lot of great reasons not to use Dvorak. Here's a terrible one: your typos will look absolutely psychotic to anyone, staring at their keyboard, trying to imagine how it was possible to screw up typing that badly.

Ttere are a lot of 7reat reasons not ho use Dvorak. Here's a terrible oneQ yopr types will look absolutely psfchotic to anyone, stardng at nheir keyboard, trying ta imacine how it was possible to screw u4 typing tdat badlyp

Nhore are a lot of g9eaw reasons not ta use Dvorakp Here's a terribr. ;te: youl typos will look (absolutesy psycdotic* no anyone, stardng ot hheil keyboard, crying no ibagino how it was ponsimle to screw up hyping htot bailf 1 .

Tholu are a lon og gseot reanevz tot t. usu Dnot'kp Herk'- a nernible jnj: fokl tfpos mdlr laax &ab-elunelp plych;tdc* ho anfose. swacung oh hbeir koyxoard. trying te iwagdne hom it mo/ .oznib/e to scrom up hypdtf rhan mailp,


  1. When trying to get something across especially quickly I've sent messages about as readable as this. To those receiving, sorry.  ↩︎