Digestive
function displayTrait() { const set = [ {range: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], trait: 'Acid Reflux'}, {range: [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30], trait: 'Constipation'}, {range: [31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47], trait: 'Diarrhea'}, {range: [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80], trait: 'Food Intolerance'}, {range: [81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97], trait: 'Incontinence'}, {range: [98, 99, 100], trait: 'Pervasive Hunger'} ]; const randomNum = Math.floor(Math.random() * 100) + 1; let selectedTrait = ''; for (const item of set) { if (randomNum >= item.range[0] && randomNum <= item.range[item.range.length - 1]) { selectedTrait = item.trait; break; } } document.getElementById('trait').innerHTML = selectedTrait; }
d100 | Trait |
---|---|
01–15 | Acid Reflux |
16–30 | Constipation |
31–47 | Diarrhea |
48–80 | Food Intolerance |
81–97 | Incontinence |
98–100 | Pervasive Hunger |