template

package
v0.1.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package template fills the templates of tasks: it counts the instances of a template, builds each one with its numbers and the results of its solver, and picks the instance of an attempt from the attempt's seed (format/README.md, sections 22–24; R60 spec, R61 spec). api calls it for the instance of an attempt, and the check of a module for every instance.

AttemptInstance picks the instance of an attempt by its number, from the place of randomness of the attempt's seed that the format gives a template, through internal/random (R10). The instances themselves and the results of a solver come with the tasks of templates and of solvers (R16).

Index

Constants

View Source
const MaxInstances = 10000

MaxInstances is the most instances a template has: the sizes of its domains multiply to at most 10 000 (format/README.md, section 23).

Variables

View Source
var ErrDomain = random.ErrDomain

ErrDomain is what AttemptInstance gives on an argument outside its domain: a count outside 1 to MaxInstances, or an ID that is no name of a place of randomness. It is the generator's own, so that errors.Is finds it whichever of the two gives it.

Functions

func AttemptInstance

func AttemptInstance(seed uint64, task formatv0.TaskID, count int) (int, error)

AttemptInstance gives the number of the instance that an attempt on a template gets, from 0: below(count) of the place of randomness of the attempt's seed whose names are template, the ID of the task and instance, where count is how many instances the template has, from 1 to MaxInstances (format/README.md, sections 22 and 23; R60 spec). Nothing else draws from that place, so the same package and the same seed give the same instance (R03 spec). The instances are numbered in the order of the odometer, as the package carries their numbers.

api draws the seed from a cryptographic source when the attempt begins and passes it here as a number; neither the seed nor the words of the place reach the learner's device, since the words show the seed (format/README.md, section 22). A count outside its domain gives ErrDomain, and so does an ID that is no name of a place: empty, or holding | or what is not UTF-8. The ID of a valid task is neither (common.schema.json).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL