From: Carl Worth Date: Sun, 14 Jun 2020 16:37:27 +0000 (-0700) Subject: Tweak game-ID generation toward more frequently used letters X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=3d164c48d0b979afdd83f58af9bb47e7c89c1877;hp=3d164c48d0b979afdd83f58af9bb47e7c89c1877;p=lmno-server Tweak game-ID generation toward more frequently used letters I'd noticed recently that game IDs seemed to have more Qs, Zs, and Js than it felt like they should. In fact, all letters were being given an equal probability of appearing, but that doesn't match our expectation that some letters should be "rare". In this commit we tweak the selection of letters toward more "common" letters. This should hopefully give game ID strings that are slightly more "friendly" looking in general. The set of available game ID values isn't reduced here (at least because of the above, but it is reduced because of part of what is described below), but when many game IDs are allocated it can now take longer for the random-selection algorithm to find an available one. We also switch from using 'B' and 'F'/'X' to instead using 'P' and 'S', again favoring letters that English speakers expect to be "common". This actually fixes a bug which I hadn't noticed before, in that the code has always been replacing a '5' in the input with 'S' but doing that after 'S' was replaced with 'F', so any input with '5' would not be mapped as intended. Now an input of '5' will work in the place of 'S'. ---