CONTRACTS: Display contract answers on completely failed contracts (#2440)

This commit is contained in:
Adam Weeden
2026-01-08 16:21:52 -05:00
committed by GitHub
parent edf3d11b72
commit 7af9dca6bc
23 changed files with 221 additions and 48 deletions
+3 -1
View File
@@ -33,11 +33,13 @@ interface CodingContractType<Data, Answer, State = Data> {
difficulty: number;
/** Function that generates a valid 'state' for a contract type */
generate: () => State;
/** Function that returns an answer, if possible, for a given contract */
getAnswer: (data: Data) => Answer | null;
/**
* Transforms the 'state' for a contract into its 'data'. The state is
* stored persistently as JSON, so it must be serializable. The data is what
* is given to the user and shown in the description. If this function is
* ommitted, it will be the identity function (i.e. State == Data).
* omitted, it will be the identity function (i.e. State == Data).
* You can use this to make problems where the "solver" is not a function
* that can be copy-pasted to user code to solve the problem.
*/