This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const UINT32_RADIX = Math.pow(2, 32); | |
| const UINT8_MAX = 0b11111111; | |
| const ENCODING = '0123456789ABCDEFGHJKMNPQRSTVWXYZ'; | |
| export const ulid = (): string => { | |
| const time = Date.now(); | |
| const bytes = crypto.getRandomValues(new Uint8Array(16)); | |
| const low = time % UINT32_RADIX; | |
| const high = (time - low) / UINT32_RADIX; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "ammo": [ | |
| "#Boxed Ammo", | |
| "AmmoBox_00buck_10rnd", | |
| "AmmoBox_12gaRubberSlug_10Rnd", | |
| "AmmoBox_12gaSlug_10Rnd", | |
| "AmmoBox_22_50Rnd", | |
| "AmmoBox_357_20Rnd", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class Network { | |
| #weights = [] as number[]; | |
| #bias = 0; | |
| #alpha = 0.1; | |
| constructor(alpha: number, size: number) { | |
| this.#alpha = alpha | |
| this.#weights = new Array(size).fill(0).map(() => Math.random() * 2 - 1); |