Template:Home/DailyOffset
More actions
The day's offset into a title-sorted pool, for the daily picks on the Main Page: the picture of the day, the featured article, the featured accession, the featured growing region and the four featured growing areas.
Parameters:
- 1: the size of the pool (usually a
format=countask). An empty or zero
count returns 0, so the calling ask never divides by zero.
- z: the day of the year, 0 to 365. Defaults to today's (
{{#time:z}}).
Pass it to see what another day picks.
The offset is the day times a stride of 97, modulo the pool size. Stepping one item a day would show alphabetical neighbours on neighbouring days (one seed company's lines a week running); a stride lands each day far from the day before, and still shows every item once per cycle, because 97 is prime and shares no factor with the pool. When the pool is itself a multiple of 97 (97, 194, 291, 388, 485 …) the stride would cycle through only a few items, so the template uses 89 for those sizes instead.
The pool size is read once: a template parameter is expanded a single time, however often the template uses it.