Creating buckets of letters with equal probability
Next task: deciding whether a word will be a monster, a weapon, an armor etc. I want to do this by picking the middle character of a word, and then, depending on that character, decide which kind of dungeon entity it will be. Therefore let's create a fixed number of buckets, one or two per kind, and assign letters to each bucket so that each bucket contains letters of the same overall likelihood to appear in the English language. Sounds complicated? Not for ChatGPT. First I let it come up with the letter probabilities: Now I need a constant array that contains the letter probabilities of the english language - the first element the probability of an "a", the 25th the one of a "z". Can you create this in JS? Output: const letterProbabilities = [ 0.0817, // a 0.0149, // b 0.0278, // c 0.0425, // d 0.1270, // e 0.0223, // f 0.0202, // g 0.0609, // h 0.0697, // i 0.0015, // j 0.0077, // k 0.0403, // l ...

Kommentare
Kommentar veröffentlichen