Skip to content

Instantly share code, notes, and snippets.

@Thann
Last active December 22, 2019 20:05
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 Thann/03a622fec104ddac286adb53e49a7506 to your computer and use it in GitHub Desktop.
Save Thann/03a622fec104ddac286adb53e49a7506 to your computer and use it in GitHub Desktop.
Generate random South Park episode
#!/usr/bin/env node
// SouthPark random expisode generator
// Comment out seasons to exlude them =]
const num_episodes = Object.entries({
1: 13,
2: 18,
3: 17,
4: 17,
5: 14,
6: 17,
7: 15,
8: 14,
9: 14,
10: 14,
11: 14,
12: 14,
13: 14,
14: 14,
15: 14,
16: 14,
17: 10,
18: 10,
19: 10,
20: 10,
21: 10,
22: 10,
23: 10,
});
seasonIndex = parseInt(Math.random()*1000) % num_episodes.length;
season = num_episodes[seasonIndex][0]
episode = (parseInt(Math.random()*1000) % num_episodes[seasonIndex][1]) +1;
console.log(`Season: ${season}, Episode: ${episode}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment