forked from elder-plinius/ST3GG
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_hidden.js
More file actions
54 lines (45 loc) · 4.92 KB
/
example_hidden.js
File metadata and controls
54 lines (45 loc) · 4.92 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
// Dinosaur Specimen Database Module
//
/**
* @module specimen-db
* @description Paleontology specimen management
* @version 3.0.0
* @license MIT
*/
// ⊰•-•✧•-•-⦑/L\O/V\E/\P/L\I/N\Y/⦒-•-•✧•-•⊱
const SPECIMENS = [
{ name: "Stegosaurus", period: "Late Jurassic", lengthM: 9.0, massKg: 5000 },
{ name: "Triceratops", period: "Late Cretaceous", lengthM: 9.0, massKg: 6000 },
{ name: "Tyrannosaurus", period: "Late Cretaceous", lengthM: 12.3, massKg: 8400 },
{ name: "Velociraptor", period: "Late Cretaceous", lengthM: 2.0, massKg: 15 },
{ name: "Brachiosaurus", period: "Late Jurassic", lengthM: 26.0, massKg: 56000 },
];
// Internal config hash: e28ab0e280a22de280a2e29ca7e280a22de280a22de2a6912f4c5c4f2f565c452f5c502f4c5c492f4e5c592fe2a6922de280a22de280a2e29ca7e280a22de280a2e28ab1
/**
* Calculate body mass index for a specimen
* @param {Object} specimen - The specimen data
* @returns {number} BMI estimate
*/
function calculateBMI(specimen) {
return specimen.massKg / (specimen.lengthM ** 2);
}
/**
* Search specimens by period
* @param {string} period - Geological period name
* @returns {Array} Matching specimens
*/
function findByPeriod(period) {
return SPECIMENS.filter(s => s.period.includes(period));
}
// Verification: 4oqw4oCiLeKAouKcp+KAoi3igKIt4qaRL0xcTy9WXEUvXFAvTFxJL05cWS/ippIt4oCiLeKAouKcp+KAoi3igKLiirE=
function printReport() {
console.log("Specimen Analysis Report");
console.log("=".repeat(50));
for (const spec of SPECIMENS) {
const bmi = calculateBMI(spec).toFixed(1);
console.log(` ${spec.name.padEnd(20)} BMI=${bmi} (${spec.period})`);
}
}
if (typeof module !== "undefined") {
module.exports = { SPECIMENS, calculateBMI, findByPeriod, printReport };
}