Decryptu/zigdex
A better zig version of pokeget.
| Command | Mean [ยตs] | Min [ยตs] | Max [ยตs] | Relative |
|---|---|---|---|---|
zigdex random |
751.0 ยฑ 276.3 | 369.9 | 6820.5 | 1.00 |
pokeget random |
1281.6 ยฑ 291.6 | 956.8 | 4184.1 | 1.71 ยฑ 0.74 |
krabby random |
3949.6 ยฑ 766.9 | 3284.2 | 13323.7 | 5.26 ยฑ 2.19 |
zigdex โโโโโโโโโโ 0.75ms โ 5.3x faster than krabby
pokeget โโโโโโโโโโ 1.28ms
krabby โโโโโโโโโโ 3.95ms
Benchmarked with hyperfine --warmup 3
brew tap Decryptu/tap
brew install zigdex
Note: While zigdex is being reviewed for inclusion in Homebrew core, you can install it from my personal tap.
Download the appropriate binary for your architecture from the releases page and add it to your PATH.
zig build
This will:
assets/ directory at compile timezig-out/bin/zigdex# Random Pokemon (1/128 chance for shiny)
zigdex --random
# Specific Pokemon by name
zigdex pikachu
zigdex bulbasaur charmander squirtle
# By Pokedex number
zigdex 25
zigdex 1 4 7
# Force shiny variant
zigdex pikachu --shiny
zigdex --random --shiny
# Hide Pokemon name
zigdex pikachu --hide-name
zigdex --random --hide-name
Add to your .zshrc or .bashrc:
# Show random Pokemon on terminal start
zigdex --random --hide-name
# Or with fastfetch
alias fastfetch='zigdex --random --hide-name | command fastfetch --logo-type file-raw --logo -'
zigdex/
โโโ src/
โ โโโ main.zig # Entry point and CLI
โ โโโ args.zig # Argument parser
โ โโโ sprites.zig # Pokemon lookup and display
โโโ tools/
โ โโโ generate_sprites.zig # Build-time sprite embedder
โโโ assets/
โ โโโ pokemon.json
โ โโโ colorscripts/
โ โโโ regular/ # Normal sprites
โ โโโ shiny/ # Shiny variants
โโโ build.zig
generate_sprites.zig tool runs during buildembedded_sprites.zig with all Pokemon datastd.Random.DefaultPrng with nanosecond seedSupports multiple lookup methods:
pikachu, PIKACHU)charizard-mega-x)25, 150)GeneralPurposeAllocator for safetydefer patterns for cleanup| Option | Short | Description |
|---|---|---|
--random |
-r |
Display random Pokemon (1/128 shiny) |
--shiny |
-s |
Force shiny variant |
--hide-name |
Don't print Pokemon name | |
--help |
-h |
Show help message |
assets/ directoryMIT