|
| 1 | +#include "game_of_thrones-dothrakis_lib.h" |
| 2 | + |
| 3 | +#include <vector> |
| 4 | +#include <string> |
| 5 | +#include <random> |
| 6 | + |
| 7 | +/* Full name lists copied from the original JavaScript generator */ |
| 8 | +static const std::vector<std::string> namesMale = { |
| 9 | + "Acchakko (Acchakat, To silence)", "Achrallo (Achralat, To be smelly)", "Addrivo (Addrivat, To kill)", |
| 10 | + "Addro (Addrivat, To kill)", "Aggendo (Aggendat, To rip something)", "Aggo (Aggendat, To rip something)", |
| 11 | + "Ahesso (Ahesh, Snow)", "Annakko (Annakholat, To finish)", "Annitho (Annithat, To cause pain)", |
| 12 | + "Anno (Annithat, To cause pain)", "Aresso (Aresak, Coward)", "Arrisso (Arrisat, To fix)", "Arro (Arrisat, To fix)", |
| 13 | + "Arrokko (Arrokhat, To frighten)", "Assammo (Assamvat, To break)", "Assilo (Assilat, To defeat)", |
| 14 | + "Asso (Assamvat, To break)", "Assollo (Assolat, To command)", "Astillo (Astilat, To joke)", |
| 15 | + "Astollo (Astolat, To speak)", "Awazzo (Awazat, To scream)", "Ayollo (Ayolat, To wait)", |
| 16 | + "Azzafro (Azzafrolat, To enslave)", "Azzo (Azzisat, To harm someone)", "Chakko (Chakat, To be silent)", |
| 17 | + "Charro (Charloat, To listen)", "Chommo (Chomat, To be respectful)", "Chomokko (Chomokh, Honor)", |
| 18 | + "Chongo (Chongat, To be hard)", "Dallo (Dalfe, Cow/Beef)", "Davro (Davra, Good/Useful)", |
| 19 | + "Davrollo (Davralat, To be useful)", "Dirgo (Dirgat, To think)", "Disso (Dis, Simple/Plain)", |
| 20 | + "Donno (Donat, To shout)", "Drogo (Drogat, To drive)", "Edavro (Edavrasa, Useless)", |
| 21 | + "Ematto (Emat, To smile)", "Emmatto (Emmat, To amuse)", "Enosso (Enossho, Mule)", |
| 22 | + "Erro (Erin, Kind/Good)", "Esitto (Esittesalat, To brag)", "Essino (Esinalat, To be different)", |
| 23 | + "Esso (Esina, Different)", "Ezollo (Ezolat, To learn)", "Ezzo (Ezat, To find)", |
| 24 | + "Ezzollo (Ezzolat, To teach)", "Fakko (Fakat, To kick)", "Fejo (Fejat, To hate)", |
| 25 | + "Fesho (Feshith, Tree)", "Ficho (Fichat, To take/To bring)", "Filko (Filkak, Coward)", |
| 26 | + "Fitto (Fitte, Short)", "Fonno (Fonak, Hunter)", "Fono (Fonat, To Hunt)", |
| 27 | + "Gacho (Gachat, To solve)", "Gezro (Gezri, Snake)", "Gorro (Gorat, To charge)", |
| 28 | + "Gosho (Goshat, To be sure)", "Haji (Haj, Strong)", "Havvo (Havziven, Lazy)", |
| 29 | + "Havzo (Havziven, Lazy)", "Hezho (Hezhahat, To travel)", "Hezzo (Hezhahat, To travel)", |
| 30 | + "Hlizzo (Hlizif, Bear)", "Hrazzo (Hrazef, Horse)", "Idrillo (Idrilat, To guide)", |
| 31 | + "Ifakko (Ifak, Foreigner)", "Ildatto (Ildat, To strike)", "Ildo (Ildat, To strike)", |
| 32 | + "Izzo (Izzat, To poison)", "Jasso (Jasat, To laugh)", "Jazzo (Jazat, To block)", |
| 33 | + "Jezzo (Jezat, To block a strike)", "Jillo (Jilat, To be right)", "Kaffatto (Kaffat, To crush)", |
| 34 | + "Kaffo (Kafat, To smash)", "Karlinno (Karlinat, To gallop)", "Karlo (Karlinat, To gallop)", |
| 35 | + "Kesso (Kesselat, To carry)", "Kovarro (Kovarat, To stand)", "Krazzo (Krazaaj, Mountain)", |
| 36 | + "Lajatto (Lajat, To fight)", "Lajo (Lajak, Fighter/Warrior)", "Lanno (Lanat, To run)", |
| 37 | + "Lanqo (Lanqoyi, Killing spree)", "Lavakho (Lavakhat, To be loud)", "Layafo (Layafat, To be happy)", |
| 38 | + "Leqso (Leqse, Rat)", "Lojatto (Lojat, To hit)", "Loqqo (Loqam, Arrow)", |
| 39 | + "Losho (Loshak, Guard)", "Losso (Loshak, Guard)", "Marillo (Marilat, To construct)", |
| 40 | + "Marro (Marilat, To construct)", "Mattello (Mattelat, To limp)", "Matto (Mattelat, To limp)", |
| 41 | + "Mello (Melat, To be evil)", "Mosko (Moskat, To load/To pack)", "Movvo (Movek, Warlock/Magician)", |
| 42 | + "Najaho (Najahak, Winner)", "Najaho (Najahat, To be victorious)", "Najo (Najah, Victorious)", |
| 43 | + "Naqo (Naqis, Small)", "Navvo (Navik, Beginner)", "Neggo (Negwin, Stone)", |
| 44 | + "Nevakko (Nevak, Guest)", "Nivvo (Nivat, To frown)", "Nizho (Nizhat, To be tough)", |
| 45 | + "Nizzo (Nizhat, To be tough)", "Ogatto (Ogat, To slaughter)", "Ohollo (Oholat, To be still)", |
| 46 | + "Onqo (Onqothat, To walk)", "Ostatto (Ostat, To bite)", "Ovvetho (Ovvethat, To throw/To shoot)", |
| 47 | + "Ovvo (Ovah, Fat)", "Qotho (Qothat, To be loyal)", "Qotho (Qothat, To be loyal/To be repetitive)", |
| 48 | + "Qotto (Qothat, To be loyal/To be repetitive)", "Qovvo (Qovat, To tremble)", "Rakharo (Rakh, Boy)", |
| 49 | + "Remekko (Remekat, To sleep)", "Remmo (Remekat, To sleep)", "Rhaego (Rhaek, Athlete)", |
| 50 | + "Rhanno (Rhanat, To be merciful)", "Rhello (Rhelat, To help)", "Sajo (Sajak, Rider)", |
| 51 | + "Shiggo (Shigat, To snore)", "Shiko (Shigat, To snore)", "Shovvo (Shoven, Marked/Smudged)", |
| 52 | + "Sikhtello (Sikhtelat, To spit)", "Sikko (Sikhtelat, To spit)", "Temmo (Temme, Thunder)", |
| 53 | + "Thirro (Thirlat, To survive)", "Tihho (Tihat, To look/To see)", "Tihollo (Tiholat, To understand)", |
| 54 | + "Tokko (Toki, Dumb)", "Vazzo (Vaz, Storm)", "Verakko (Verak, Traveler)", "Verro (Ver, Wolf)", |
| 55 | + "Verro (Verat, To travel)", "Villo (Villat, To be wise)", "Vindello (Vindelat, To stab)", |
| 56 | + "Vinesso (Vineserat, To remember)", "Virsallo (Virsalat, To burn)", |
| 57 | + "Vitihho (Vitihirat, To watch/To oberserve)", "Vorro (Vorsa, Fire)", "Vorsakko (Vorsakh, Flame)", |
| 58 | + "Vorso (Vorsa, Fire)", "Vrozzo (Vroz, Slow)", "Yenno (Yeni, Failure)", "Zerqo (Zerqolat, To swim)", |
| 59 | + "Zerqollo (Zerqolat, To swim)", "Zhowakko (Zhowak, Dangerous)", "Zhowo (Zhowak, Dangerous)", |
| 60 | + "Zicho (Zichome, Disrespectful)", "Zichommo (Zichome, Disrespectful)", "Ziffo (Zifichelat, To steal)", |
| 61 | + "Zificho (Zifichelat, To steal)", "Ziganno (Ziganesolat, To defy/To oppose)", |
| 62 | + "Ziggo (Ziganesolat, To defy/To oppose)", "Zinemmo (Zimemelat, To distract)", |
| 63 | + "Zinno (Zimemelat, To distract)", "Zireyo (Zireyeselat, To offend/To bug)", |
| 64 | + "Zirqo (Zirqoyi, Bird of prey)", "Zirro (Zireyeselat, To offend/To bug)", |
| 65 | + "Zoratto (Zorat, To roar)", "Zorro (Zorat, To roar)" |
| 66 | +}; |
| 67 | + |
| 68 | +static const std::vector<std::string> namesFemale = { |
| 69 | + "Acchi (Acchakat, To silence)", "Achralli (Achralat, To be smelly)", "Achri (Achralat, To be smelly)", |
| 70 | + "Affi (Affisat, To clean)", "Affisi (Affisat, To clean)", "Aheshi (Ahesh, Snow)", "Ahi (Ahesh, Snow)", |
| 71 | + "Allayi (Allayafat, To please)", "Annithi (Annithat, To cause pain)", "Aressi (Aresak, Coward)", |
| 72 | + "Ari (Aresak, Coward)", "Asavvi (Asavva, Sky)", "Asheffi (Ashefa, River)", "Ashi (Ashefa, River)", |
| 73 | + "Awazzi (Awazat, To scream)", "Awwi (Awazat, To scream)", "Ayi (Ayolat, To wait)", "Ayolli (Ayolat, To wait)", |
| 74 | + "Chakki (Chakat, To be silent)", "Charli (Charloat, To listen)", "Charri (Charloat, To listen)", |
| 75 | + "Chelli (Chelsian, Locust)", "Chelsi (Chelsian, Locust)", "Chommi (Chomat, To be respectful)", |
| 76 | + "Dalfi (Dalfe, Cow/Beef)", "Dalli (Dalfe, Cow/Beef)", "Davralli (Davralat, To be useful)", |
| 77 | + "Davri (Davra, Good/Useful)", "Davvi (Davra, Good/Useful)", "Dissi (Dis, Simple/Plain)", |
| 78 | + "Edavri (Edavrasa, Useless)", "Emmati (Emmat, To amuse)", "Emmi (Emat, To smile)", |
| 79 | + "Enosshi (Enossho, Mule)", "Enossi (Enossho, Mule)", "Erri (Erin, Kind/Good)", "Eshi (Eshina, Fish)", |
| 80 | + "Eshinni (Eshina, Fish)", "Esinni (Esina, Different)", "Esinni (Esinalat, To be different)", |
| 81 | + "Essi (Esina, Different)", "Evethi (Eveth, Water)", "Evi (Eveth, Water)", "Ewwi (Ewe, Olive)", |
| 82 | + "Eyelli (Eyel, Rain)", "Ezhi (Ezhirat, To dance)", "Ezhirri (Ezhirat, To dance)", |
| 83 | + "Ezolli (Ezolat, To learn)", "Ezzi (Ezolat, To learn)", "Ezzoli (Ezzolat, To teach)", |
| 84 | + "Feldi (Feldekh, Feather)", "Felli (Feldekh, Feather)", "Fichi (Fichat, To take/To bring)", |
| 85 | + "Filki (Filkak, Coward)", "Filli (Filkak, Coward)", "Fitti (Fitte, Short)", "Gevvi (Geve, Mole)", |
| 86 | + "Gilli (Gillo, Breeze)", "Gizzi (Giz, Bee)", "Haddi (Hador, Gust of wind)", "Haffi (Haf, Soft/Quiet)", |
| 87 | + "Haji (Haj, Strong)", "Halahhi (Halah, Flower)", "Halli (Halah, Flower)", "Hanni (Hanna, Rose)", |
| 88 | + "Havazhi (Havazh, Sea)", "Havvi (Havazh, Sea)", "Havzi (Havziven, Lazy)", "Hoski (Hoska, Mouth of an animal)", |
| 89 | + "Hossi (Hoska, Mouth of an animal)", "Hoyalli (Hoyalat, To sing)", "Hoyi (Hoyalat, To sing)", |
| 90 | + "Ifakki (Ifak, To walk)", "Iffi (Ifak, Foreigner)", "Ikhi (Ikh, Ashes)", "Inti (Inte, Beetle)", |
| 91 | + "Irri (Irra, Trout)", "Izzatti (Izzat, To poison)", "Izzi (Iz, Poison)", "Janni (Jano, Dog)", |
| 92 | + "Jasatti (Jasat, To laugh)", "Jassi (Jasat, To laugh)", "Jeddi (Jedda, Pony)", "Jeshi (Jesh, Ice)", |
| 93 | + "Jolinni (Jolinat, To cook)", "Jolli (Jolinat, To cook)", "Jommi (Joma, Salmon)", "Kendri (Kendra, Opal)", |
| 94 | + "Kesselli (Kesselat, To carry)", "Kessi (Kesselat, To carry)", "Khewi (Khewo, Worm)", "Laqqi (Laqat, To cry)", |
| 95 | + "Lavakhi (Lavakhat, To be loud)", "Lavvi (Lavakhat, To be loud)", "Layaffi (Layafat, To be happy)", |
| 96 | + "Layi (Layafat, To be happy)", "Leqsi (Leqse, Rat)", "Loshatti (Loshat, To carry)", "Loshi (Loshat, To carry)", |
| 97 | + "Madatti (Madat, To sew)", "Maddi (Madat, To sew)", "Mattelli (Mattelat, To limp)", "Matti (Mattelat, To limp)", |
| 98 | + "Mavelli (Mavelat, To make by hand)", "Mavi (Mavelat, To make by hand)", "Mawi (Mawizzi, Rabbit)", |
| 99 | + "Melli (Melat, To be evil)", "Naqqi (Naqis, Small)", "Navvi (Navik, Beginner)", "Nevvi (Nevak, Guest)", |
| 100 | + "Nivvi (Nivat, To frown)", "Nizhi (Nizhat, To be tough)", "Oholli (Oholat, To be still)", "Oqetti (Oqet, Sheep)", |
| 101 | + "Oqqi (Oqet, Sheep)", "Osti (Ostat, To bite)", "Ovahhi (Ovah, Fat)", "Ovvi (Ovah, Fat)", "Ozzi (Ozzir, Ruby)", |
| 102 | + "Ozzirri (Ozzir, Ruby)", "Qiffi (Qifo, Boar/Pig)", "Qossi (Qosar, Spider)", "Qothi (Qothat, To be loyal/To be repetitive)", |
| 103 | + "Qovatti (Qovat, To tremble)", "Qovvi (Qovat, To tremble)", "Remekki (Remekat, To sleep)", "Remmi (Remekat, To sleep)", |
| 104 | + "Rhelli (Rhelat, To help)", "Shovi (Shoven, Marked/Smudged)", "Thashi (Thash, Soft)", "Thirli (Thirlat, To survive)", |
| 105 | + "Thirri (Thirlat, To survive)", "Verakki (Verak, Traveler)", "Verri (Verak, Traveler)", "Vitihi (Vitihirat, To watch/To oberserve)", |
| 106 | + "Vitti (Vitihirat, To watch/To oberserve)", "Vorri (Vorsa, Fire)", "Vorsakhi (Vorsakh, Flame)", "Vrozzi (Vroz, Slow)", |
| 107 | + "Yetti (Yetto, Frog)", "Zhali (Zhalia, Butterfly)", "Zhalli (Zhalia, Butterfly)", "Zhavvi (Zhav, Lizard)", |
| 108 | + "Zhowi (Zhowak, Dangerous)", "Zichi (Zichome, Disrespectful)", "Zichomi (Zichome, Disrespectful)", "Ziffi (Zifichelat, To steal)", |
| 109 | + "Zifichi (Zifichelat, To steal)", "Ziganni (Ziganesolat, To defy/To oppose)", "Ziggi (Ziganesolat, To defy/To oppose)", |
| 110 | + "Zimemmi (Zimemelat, To distract)", "Zimmi (Zimemelat, To distract)", "Zireyyi (Zireyeselat, To offend/To bug)", |
| 111 | + "Zirqi (Zirqoyi, Bird of prey)", "Zirri (Zir, Bird)" |
| 112 | +}; |
| 113 | + |
| 114 | +static const std::vector<std::string> namesM1 = {"", "", "", "", "", "b", "c", "d", "h", "j", "k", "m", "p", "q", "r", "bh", "ch", "jh", "kh", "qh", "rh", "br", "cr", "dr", "kr", "pr", "qr"}; |
| 115 | +static const std::vector<std::string> namesM2 = {"ae", "a", "o", "a", "o", "a", "o"}; |
| 116 | +static const std::vector<std::string> namesM3 = {"d", "dd", "h", "j", "jh", "k", "kh", "kk", "l", "ll", "m", "mm", "n", "nn", "t", "tt", "v", "z", "zh", "zz", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""}; |
| 117 | +static const std::vector<std::string> namesM4 = {"", "a", "o", "a", "o", "a", "o", "ae"}; |
| 118 | +static const std::vector<std::string> namesM5 = {"bo", "ggo", "go", "kho", "llo", "no", "qo", "rbo", "ro", "rro", "tho", "ko", "kko", "rko", "rqo", "rlo", "rgo", "mo", "nno", "mmo", "qqo", "zho", "zo", "zzo", "vo", "vvo"}; |
| 119 | + |
| 120 | +static const std::vector<std::string> namesF1 = {"", "", "", "", "f", "h", "jh", "k", "l", "m", "n", "q", "r", "s", "sh", "t", "th", "v", "w", "y", "zh"}; |
| 121 | +static const std::vector<std::string> namesF2 = {"e", "i", "a", "i"}; |
| 122 | +static const std::vector<std::string> namesF3 = {"f", "ff", "g", "h", "l", "ll", "m", "mm", "n", "nn", "q", "r", "s", "sh", "ss", "t", "th", "w", "z", "zh", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""}; |
| 123 | +static const std::vector<std::string> namesF4 = {"", "e", "i", "a", "i"}; |
| 124 | +static const std::vector<std::string> namesF5 = {"bi", "ffi", "fi", "ssi", "si", "gi", "hhi", "hi", "ki", "kki", "lli", "mi", "mmi", "ni", "nni", "qi", "qqi", "qui", "ri", "rri", "thi", "vi", "vvi", "wi", "zhi", "zi", "zzi"}; |
| 125 | + |
| 126 | +std::string generate_game_of_thrones_dothrakis_name(std::mt19937& rng) { |
| 127 | + bool female = (rng() % 2) == 1; // 0 = male, 1 = female |
| 128 | + int i = static_cast<int>(rng() % 10); // mimic Math.floor(Math.random()*10) |
| 129 | + |
| 130 | + if (female) { |
| 131 | + if (i < 5) { |
| 132 | + std::uniform_int_distribution<std::size_t> dist(0, namesFemale.size() - 1); |
| 133 | + return namesFemale[dist(rng)]; |
| 134 | + } else { |
| 135 | + std::uniform_int_distribution<std::size_t> d1(0, namesF1.size() - 1); |
| 136 | + std::uniform_int_distribution<std::size_t> d2(0, namesF2.size() - 1); |
| 137 | + std::uniform_int_distribution<std::size_t> d3(0, namesF3.size() - 1); |
| 138 | + std::uniform_int_distribution<std::size_t> d4(0, namesF4.size() - 1); |
| 139 | + std::uniform_int_distribution<std::size_t> d5(0, namesF5.size() - 1); |
| 140 | + |
| 141 | + std::size_t idx1 = d1(rng); |
| 142 | + std::size_t idx2 = d2(rng); |
| 143 | + std::size_t idx3 = d3(rng); |
| 144 | + std::size_t idx4 = d4(rng); |
| 145 | + std::size_t idx5 = d5(rng); |
| 146 | + |
| 147 | + if (idx1 < 4) { |
| 148 | + while (idx2 == 0) { |
| 149 | + idx2 = d2(rng); |
| 150 | + } |
| 151 | + } |
| 152 | + if (idx3 > 19) { |
| 153 | + idx4 = 0; |
| 154 | + } else { |
| 155 | + while (idx4 == 0) { |
| 156 | + idx4 = d4(rng); |
| 157 | + } |
| 158 | + } |
| 159 | + return namesF1[idx1] + namesF2[idx2] + namesF3[idx3] + namesF4[idx4] + namesF5[idx5]; |
| 160 | + } |
| 161 | + } else { |
| 162 | + if (i < 5) { |
| 163 | + std::uniform_int_distribution<std::size_t> dist(0, namesMale.size() - 1); |
| 164 | + return namesMale[dist(rng)]; |
| 165 | + } else { |
| 166 | + std::uniform_int_distribution<std::size_t> d1(0, namesM1.size() - 1); |
| 167 | + std::uniform_int_distribution<std::size_t> d2(0, namesM2.size() - 1); |
| 168 | + std::uniform_int_distribution<std::size_t> d3(0, namesM3.size() - 1); |
| 169 | + std::uniform_int_distribution<std::size_t> d4(0, namesM4.size() - 1); |
| 170 | + std::uniform_int_distribution<std::size_t> d5(0, namesM5.size() - 1); |
| 171 | + |
| 172 | + std::size_t idx1 = d1(rng); |
| 173 | + std::size_t idx2 = d2(rng); |
| 174 | + std::size_t idx3 = d3(rng); |
| 175 | + std::size_t idx4 = d4(rng); |
| 176 | + std::size_t idx5 = d5(rng); |
| 177 | + |
| 178 | + if (idx1 < 5) { |
| 179 | + while (idx2 == 0) { |
| 180 | + idx2 = d2(rng); |
| 181 | + } |
| 182 | + } |
| 183 | + if (idx3 > 19) { |
| 184 | + idx4 = 0; |
| 185 | + } else { |
| 186 | + while (idx4 == 0) { |
| 187 | + idx4 = d4(rng); |
| 188 | + } |
| 189 | + } |
| 190 | + return namesM1[idx1] + namesM2[idx2] + namesM3[idx3] + namesM4[idx4] + namesM5[idx5]; |
| 191 | + } |
| 192 | + } |
| 193 | +} |
0 commit comments