Skip to content

Instantly share code, notes, and snippets.

@unixpickle
Created June 12, 2017 14:33
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 unixpickle/806358b8541eb2e4b6b20e29845c31b4 to your computer and use it in GitHub Desktop.
Save unixpickle/806358b8541eb2e4b6b20e29845c31b4 to your computer and use it in GitHub Desktop.
Count Universe Environments
#!/bin/bash
JSON_URL=https://raw.githubusercontent.com/openai/universe/master/universe/runtimes/flashgames.json
JSON="$(curl -s $JSON_URL)"
ALL_NAMES=$(echo "$JSON" | jq -r 'to_entries[] | select(.value.rewarder) | select(.value.autostart) | .key')
echo "Total environments:"
echo "$ALL_NAMES" | sort -u | wc -l
echo "Unique environments:"
echo "$ALL_NAMES" | sed -E 's/Lvl[0-9]*-/-/g' | sort -u | wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment