Skip to content

Instantly share code, notes, and snippets.

@jeremyjackson89
Created July 6, 2025 17:53
Show Gist options
  • Select an option

  • Save jeremyjackson89/716918f74bda041dc3fbad9363a48f59 to your computer and use it in GitHub Desktop.

Select an option

Save jeremyjackson89/716918f74bda041dc3fbad9363a48f59 to your computer and use it in GitHub Desktop.
FFIX Excalibur II quantity between release and now
// 2 per day
function isLeapYear(year) {
return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
}
var daysInYear = 365;
var startYear = 2000;
var currentYear = new Date().getFullYear();
var year = startYear;
var excalibursPerDay = 2;
var totalExcaliburIIs = 0;
while (year <= currentYear) {
totalExcaliburIIs += (daysInYear + (isLeapYear(year) ? 1 : 0)) * excalibursPerDay;
++year;
}
console.log(`Between ${ startYear } and ${ currentYear } you could get ${ totalExcaliburIIs } Excalibur IIs.`);
// at the 8.5 hours record
function isLeapYear(year) {
return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
}
var daysInYear = 365;
var startYear = 2000;
var currentYear = new Date().getFullYear();
var year = startYear;
var excalibursPerDay = parseFloat((24 / 8.5).toFixed(1));
var totalExcaliburIIs = 0;
while (year <= currentYear) {
totalExcaliburIIs += (daysInYear + (isLeapYear(year) ? 1 : 0)) * excalibursPerDay;
++year;
}
console.log(`Between ${ startYear } and ${ currentYear } you could get ${ Math.floor(totalExcaliburIIs) } Excalibur IIs if you were fast as fuck.`);
// Using the clock rollover trick
function isLeapYear(year) {
return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
}
var framesNeeded = 2**32;
var secondsInADay = 24 * 60 * 60;
var fpsNTSC = 60;
var fpsPAL = 50;
var framesPerDayNTSC = fpsNTSC * secondsInADay;
var framesPerDayPAL = fpsPAL * secondsInADay;
var totalDaysToRolloverNTSC = (framesNeeded / framesPerDayNTSC);
var totalDaysToRolloverPAL = (framesNeeded / framesPerDayPAL);
var daysInYear = 365;
var totalExcaliburIIsNTSC = 0;
var totalExcaliburIIsPAL = 0;
var startYear = 2000;
var currentYear = new Date().getFullYear();
var yearNTSC = startYear;
var yearPAL = startYear;
var daysInCurrentYear;
while (yearNTSC <= currentYear) {
daysInCurrentYear = (daysInYear + (isLeapYear(Math.floor(yearNTSC)) ? 1 : 0));
++totalExcaliburIIsNTSC;
yearNTSC += totalDaysToRolloverNTSC / daysInCurrentYear;
}
while (yearPAL <= currentYear) {
daysInCurrentYear = (daysInYear + (isLeapYear(Math.floor(yearPAL)) ? 1 : 0));
++totalExcaliburIIsPAL;
yearPAL += totalDaysToRolloverPAL / daysInCurrentYear;
}
console.log(`Between ${ startYear } and ${ currentYear } using the clock rollover trick, you could get ${ Math.floor(totalExcaliburIIsNTSC) } Excalibur IIs if you played the NTSC version, or ${ Math.floor(totalExcaliburIIsPAL) } if you played the PAL version.`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment