bitburner-src/markdown/bitburner.codingcontract.md
Snarling 837c6bd1c2
CONTRACT: codingcontract.attempt always returns a string (#231)
* ns.codingcontract always returns a string (reward on success, empty on fail), simplifying usage and documentation of function.
* Because of the above, return value still works when used as a boolean, as long as no direct equality comparison to true/false.
* Documentation expanded and examples added.
Co-authored by @quacksouls
2022-11-28 09:15:09 -05:00

1.2 KiB

Home > bitburner > CodingContract

CodingContract interface

Coding Contract API

Signature:

export interface CodingContract 

Methods

Method Description
attempt(answer, filename, host) Attempts a coding contract, returning a reward string on success or empty string on failure.
createDummyContract(type) Generate a dummy contract.
getContractType(filename, host) Get the type of a coding contract.
getContractTypes() List all contract types.
getData(filename, host) Get the input data.
getDescription(filename, host) Get the description.
getNumTriesRemaining(filename, host) Get the number of attempts remaining.