-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
112 lines (93 loc) · 4.99 KB
/
index.html
File metadata and controls
112 lines (93 loc) · 4.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Random Degree Generator</title>
</head>
<body>
<h1>Random Degree Generator</h1>
<form>
<label for="subject">Select Subject:</label><br>
<input type="radio" name="subject" value="Normal" id="subjectNormal" checked> Normal
<input type="radio" name="subject" value="Incomprehensible" id="subjectIncomprehensible"> Incomprehensible
<input type="radio" name="subject" value="Silly" id="subjectSilly"> Silly
<input type="radio" name="subject" value="All" id="subjectAll"> All
<br><br>
<label for="descriptor">Select Descriptor:</label><br>
<input type="radio" name="descriptor" value="Normal" id="descriptorNormal" checked> Normal
<input type="radio" name="descriptor" value="Incomprehensible" id="descriptorIncomprehensible"> Incomprehensible
<input type="radio" name="descriptor" value="Silly" id="descriptorSilly"> Silly
<input type="radio" name="descriptor" value="All" id="descriptorAll"> All
<br><br>
<button type="button" onclick="generateRandomDegree()">Generate</button>
</form>
<p id="generatedDegree"></p>
<script>
function generateRandomDegree() {
const subject = document.querySelector('input[name="subject"]:checked').value;
const descriptor = document.querySelector('input[name="descriptor"]:checked').value;
fetchRandomDegree(subject, descriptor);
}
function fetchRandomDegree(subject, descriptor) {
const generatedDegree = generateDegree(subject, descriptor);
displayGeneratedDegree(generatedDegree);
}
function generateDegree(subject, descriptor) {
const subjects = {
'Normal': 'normal',
'Incomprehensible': 'incomp',
'Silly': 'silly',
'All': 'all'
};
const subjectStyle = subjects[subject];
const descriptors = {
'Normal': 'normal',
'Incomprehensible': 'incomp',
'Silly': 'silly',
'All': 'all'
};
const descriptorStyle = descriptors[descriptor];
const generatedDegree = despacer(`Masters of ${degree()} in ${adjective(descriptorStyle)} ${noun(subjectStyle)}`);
return generatedDegree;
}
function displayGeneratedDegree(generatedDegree) {
const generatedDegreeElement = document.getElementById('generatedDegree');
generatedDegreeElement.textContent = generatedDegree;
}
function degree() {
const normalTypes = ['Science', 'Clinical Science', 'Medical Science', 'Biomedical Science', 'Health Science', 'Biological Science'];
return normalTypes[Math.floor(Math.random() * normalTypes.length)];
}
function noun(style) {
const normalNouns = ['Informatics', 'Investigation', 'Research', 'Analysis', 'Inspection', 'Examination', 'Reasoning', 'Inference', 'Evaluation', 'Interpretation'];
const incompNouns = ['Cogitation', 'Dialectics', 'Ratiocination', 'Syllogization', 'Illation', 'Predication', 'Rationalization', 'Clarification', 'Discernment', 'Acumen', 'Percipience'];
const sillyNouns = ['Guestimation', 'Exaggeration', 'Misinterpretation', 'Pretention', 'Fabrication', "Learnin'"];
const allNouns = normalNouns.concat(incompNouns, sillyNouns);
const subDict = {
'normal': normalNouns,
'incomp': incompNouns,
'silly': sillyNouns,
'all': allNouns
};
return subDict[style][Math.floor(Math.random() * subDict[style].length)];
}
function adjective(style) {
const normAdj = ['Research', 'Predictive', 'Quantitative', 'Evidence-Based', 'Health', 'Community', 'Medical', 'AI', 'Computing', 'Social', 'Environmental Health', 'Psychological', 'Scientific', 'Technological Health', 'Computational', 'Cognitive', 'Neurological', 'Biological'];
const incompAdj = ['Cultural Health', 'Political Health', 'Economic Health', 'Psychological', 'Educational Health', 'Historical Health', 'Financial Health', 'Spiritual Health', 'Philosophical Health', 'Mathematical Health', 'Statistical Health'];
const sillyAdj = ['Quantum', 'Pseudo-', '16th-Century', '26th-Century', 'Miscellaneous', 'Assorted', 'Recycled', 'Questionable'];
const allAdj = normAdj.concat(incompAdj, sillyAdj);
const subDict = {
'normal': normAdj,
'incomp': incompAdj,
'silly': sillyAdj,
'all': allAdj
};
return subDict[style][Math.floor(Math.random() * subDict[style].length)];
}
function despacer(str) {
return str.replace('- ', '-');
}
</script>
</body>
</html>