Created
September 1, 2019 07:40
-
-
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
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
#!/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