-
-
Save Thann/03a622fec104ddac286adb53e49a7506 to your computer and use it in GitHub Desktop.
Generate random South Park episode
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
#!/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