-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.ts
More file actions
33 lines (31 loc) · 799 Bytes
/
test.ts
File metadata and controls
33 lines (31 loc) · 799 Bytes
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
import {
gender,
bloodType,
name,
surname,
birthdate,
size,
} from "./mod.ts"
import { Material, tuple } from "https://raw.githubusercontent.com/randkid/Randkid/master/mod.ts"
const randkid = new Material({
inputMaterials: tuple([
gender,
bloodType,
name,
surname,
birthdate,
size,
]),
rand(seed, gender, bloodType, name, surname, birthdate, size,){
const height = ~~size[4] / 10
const weight = ~~(size[size.length - 12] * 10) / 10
return `
${surname.match(/.* (.*)\(.*\)/)?.[1]}${name} (${gender == "f" ? "여" : "남"}, ${2021 - new Date(birthdate).getFullYear()})
${bloodType}형
${height}cm
${weight}kg
BMI: ${~~(weight / (height / 100) ** 2 * 10) / 10}
`
}
})
console.log(randkid.rand(0))