Skip to content

Instantly share code, notes, and snippets.

@marcosrocha85
Created February 9, 2026 00:58
Show Gist options
  • Select an option

  • Save marcosrocha85/b4d47b74e97e6290e781a9c05a992a0e to your computer and use it in GitHub Desktop.

Select an option

Save marcosrocha85/b4d47b74e97e6290e781a9c05a992a0e to your computer and use it in GitHub Desktop.
Super Bowl - Predictions
const NFL_GAME_VARIANCE = 5; // typical point deviation in NFL games
function predictSuperBowlWinner(
favorite: string,
underdog: string,
spread: number
): string {
// Simulates realistic noise: ±5 points around the spread
const randomFactor = Math.random() * (NFL_GAME_VARIANCE * 2) - NFL_GAME_VARIANCE;
return randomFactor > spread
? `${underdog} pulls off an upset!`
: `${favorite} wins as expected.`;
}
console.log(predictSuperBowlWinner('Seahawks', 'Patriots', 4.5)); // Run it several times
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment