Skip to content

Instantly share code, notes, and snippets.

@seb-jones
Created September 1, 2019 07:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seb-jones/7d3fee11fb3fe81edec777c038453cc9 to your computer and use it in GitHub Desktop.
Save seb-jones/7d3fee11fb3fe81edec777c038453cc9 to your computer and use it in GitHub Desktop.
Generates the timestamps for the Youtube Description of a video showcasing all combinations from Pokemon Fusion
#!/bin/bash
#
# Pokemon Fusion Time Stamp Generator
#
# Requires a single plaintext file containing the names of each Pokemon in the
# First Generation Pokedex, one per line, in Pokedex order.
SECONDS_PER_MINUTE=60
MINUTES_PER_HOUR=60
SECONDS_PER_POKEMON=150
HOURS=0
MINUTES=0
SECONDS=0
I=0
cat pokedex | while read POKEMON
do
if [[ $HOURS -gt 0 ]]; then
printf "%d:%02d:" $HOURS $MINUTES
else
printf "%d:" $MINUTES
fi
printf "%02d" $SECONDS
echo -e "\t$POKEMON"
SECONDS=$((SECONDS + $SECONDS_PER_POKEMON))
while [[ $SECONDS -ge $SECONDS_PER_MINUTE ]]; do
((MINUTES++))
while [[ $MINUTES -ge $MINUTES_PER_HOUR ]]; do
((HOURS++))
MINUTES=$((MINUTES - MINUTES_PER_HOUR))
done
SECONDS=$((SECONDS - $SECONDS_PER_MINUTE))
done
((I++))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment