Eli Mellen
11/14/2023, 7:47 PMsmt
11/14/2023, 8:31 PMMike Austin
11/14/2023, 10:19 PMalltom
11/14/2023, 10:46 PMsmt
11/15/2023, 5:37 AMEli Mellen
11/15/2023, 12:38 PMsys.seed:<http://sys.ms|sys.ms>
cons: "|" split "b|c|d|f|g|h|j|k|l|m|n|p|r|s|t|v|w|z|ch|sh|zh|th"
vow: "|" split "a|e|i|o|u|y|ee|ai|ae|au"
on syl do random[vow],random[cons] end
on word do syl @ range random[1,2,3,4] end
on words x do " " fuse word @ range x end
speak:words[7]
show[speak]
That generates mostly pronounceable gibberish, like ushapaiw aih eez enasil auk aeshowychees ehilehuk
and ainaec eeneewaig ainimimum auvaichaef ojushychaen upenizash ac
Same program in JavaScript,
const cons = ["b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "v", "w", "z", "ch", "sh", "zh", "th"];
const vow = ["a", "e", "i", "o", "u", "y", "ee", "ai", "ae", "au"];
const rpick = t => t[Math.floor(Math.random() * t.length)];
const syl = () => rpick(cons) + rpick(vow);
const word = () => {
const syllables = Array(Math.floor(Math.random() * 3) + 1).fill(null).map(() => syl()).join('');
return Math.random() > 0.2 ? syllables + rpick(cons) : syllables;
};
const speak = numberOfWords => Array(numberOfWords).fill(null).map(() => word()).join(' ');
console.log(speak(7));