Skip to main content
100%

Parse Pokémon Trading Card Online Deckstring

✓ Published0🌍 Public
KKevinGutowski
Last edited Apr 6, 2023
Created on Apr 6, 2023

This example parses a Pokémon Trading Card Online deckstring into structured card data, displaying each card’s count, name, type (Pokémon, Trainer, or Energy), set code, number, and variant. The JavaScript function `importDeckString` splits the input by lines, filters empty entries, and extracts card metadata by splitting on spaces, detecting variants via numeric tokens, and classifying card types based on line position relative to header counts. It also normalizes energy symbols like `{G}` into names like “Grass” using the `replaceEnergyBrackets` helper, then passes the resulting array to an `updateTable` function for display.

AI-generated description

Similar vizzes