Skip to content

Instantly share code, notes, and snippets.

@shadaj
Forked from carbide-public/ untitled.carbide.md
Last active January 8, 2017 21:33
Show Gist options
  • Save shadaj/50cc00cdbf475904bab62c946956b1f7 to your computer and use it in GitHub Desktop.
Save shadaj/50cc00cdbf475904bab62c946956b1f7 to your computer and use it in GitHub Desktop.
steamworks-calculator
var autoGear = Math.round(1);
var autoHighGoals = Math.round(8.0625);
var autoLowGoals = Math.round(0);
var autoCrossedLine = Math.round(0);
var autoLowGoalsForPoints = Math.floor(autoLowGoals / 3) * 3;
var autoPoints = (autoGear * 60) + (autoHighGoals * 1) + (autoLowGoalsForPoints * (1 / 3)) + (autoCrossedLine * 5);
var teleopGears = Math.round(0);
var teleopHighGoals = Math.round(0);
var teleopLowGoals = Math.round(0);
var teleopClimb = Math.round(0);
var teleopLowGoalsWithAuto = (autoLowGoals - autoLowGoalsForPoints) + teleopLowGoals;
var teleopLowGoalsForPoints = Math.floor(teleopLowGoalsWithAuto / 9) * 9;
var teleopHighGoalsForPoints = Math.floor(teleopHighGoals / 3) * 3;
var gearPoints = teleopGears >= 12 ? (120 + 100) : (teleopGears >= 6 ? 80 : (teleopGears >= 2 ? 40 : 0));
var teleopPoints = Math.floor(teleopHighGoals / 3) + Math.floor(teleopLowGoalsForPoints / 9) + gearPoints + (teleopClimb * 50);
var allPoints = autoPoints + teleopPoints;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment