This file contains 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
import * as smogon from 'smogon'; | |
import {JSDOM} from 'jsdom'; | |
const text = await (await fetch(`https://www.smogon.com/dex/sv/formats/`)).text(); | |
const formats = smogon.Analyses.parse(text).injectRpcs[1][1].formats; | |
for (const {shorthand, genfamily} of formats) { | |
for (const gen of genfamily) { | |
const id = shorthand.toLowerCase().replaceAll(' ', '-'); | |
const url = `https://www.smogon.com/dex/${gen.toLowerCase()}/formats/${id}/`; |
This file contains 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 endian = @import("builtin").cpu.arch.endian(); | |
var bytes: usize = 0; | |
const a = std.mem.toBytes(copy)[0..376]; | |
const b = std.mem.toBytes(battle.*)[0..376]; | |
var diffs: [128]u8 = undefined; | |
var i: usize = 0; | |
var j: usize = 0; | |
while (i < 376) : (i += 2) { | |
const ai = std.mem.bytesAsValue(u16, a[i .. i + 2]).*; | |
if (ai != std.mem.bytesAsValue(u16, b[i .. i + 2]).*) { |
This file contains 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 fs = require('fs'); | |
const words = []; | |
for (const line of fs.readFileSync(process.argv[2], 'utf8').trim().split('\n')) { | |
const word = line.trim(); | |
words[word.length - 2] = words[word.length - 2] || []; | |
words[word.length - 2].push(word); | |
} | |
for (let n = 5; n <= 5; n++) { |
This file has been truncated, but you can view the full file.
This file contains 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
(AA|AB)_ AAS/ABS | |
(AA|AC)_ AAH/ACH | |
(AA|AC)___ AAHED/ACHED | |
(AA|AC)____ AAHING/ACHING | |
(AA|AD)_ AAS/ADS | |
(AA|AG)_ AAS/AGS | |
(AA|AH)_ AAS/AHS | |
(AA|AI)_ AAL/AIL AAS/AIS | |
(AA|AI)__ AALS/AILS | |
(AA|AL)_ AAL/ALL AAS/ALS |
This file contains 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 fs = require('fs'); | |
const spreads = {}; | |
const IV = 30; | |
const POWER = 70; | |
const HP = { | |
Bug: {ivs: {atk: 30, def: 30, spd: 30}, dvs: {atk: 13, def: 13}}, | |
Dark: {ivs: {}, dvs: {}}, |
This file contains 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
SIDE LYING TWIST | |
SUPINE WINDOW WIPERS | |
HIP MOBILITY DRILL | |
HALF KNEELING WALL TRUNK ROTATION | |
SINGLE LEG SIT-BACKS | |
QUICK-REBOUNDING CALF RAISE | |
ALTERNATE FORWARD LUNGE | |
SIDE LUNGE | |
STAR BALANCE TAP |
This file contains 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
import type {Battle, Side, Pokemon} from "."; | |
function encodeBattle(battle: Battle) { | |
const buf: any[] = []; | |
for (const side of battle.sides) { | |
encodeSide(side, buf); | |
} | |
buf.push(battle.turn); | |
buf.push(battle.lastDamage); |
This file contains 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
% | W | L | T | |
---|---|---|---|---|
0 | 49663 | 50117 | 220 | |
1 | 49170 | 50643 | 187 | |
2 | 48757 | 51056 | 187 | |
3 | 48208 | 51580 | 212 | |
4 | 48027 | 51772 | 201 | |
5 | 47450 | 52344 | 206 | |
6 | 46766 | 53052 | 182 | |
7 | 46154 | 53657 | 189 | |
8 | 45990 | 53827 | 183 |
This file contains 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
import {Generations} from '@pkmn/data'; | |
import {TeamGenerators} from '@pkmn/randoms'; | |
import {Battle, Dex, ID, PRNG, PRNGSeed, Teams, extractChannelMessages} from '@pkmn/sim'; | |
import {RandomPlayer} from './random-player'; | |
Teams.setGeneratorFactory(TeamGenerators as any); | |
const gens = new Generations(Dex as any); | |
const gen = gens.get(process.argv[2] ?? 1); |
This file contains 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
sProtectSuccessRates | |
FF FF | |
FF 7F | |
FF 3F | |
FF 1F | |
sMovesForbiddenToCopy | |
76 00 |