bitburner-src/markdown/bitburner.codingcontract.attempt_1.md
Olivier Gagnon feb0430aff work on doc
2021-10-30 15:46:34 -04:00

1.3 KiB
Raw Blame History

Home > bitburner > CodingContract > attempt

CodingContract.attempt() method

Attempts to solve the Coding Contract with the provided solution.

Signature:

attempt(answer: string | string[] | number, fn: string, host?: string, opts?: CodingAttemptOptions): boolean | string;

Parameters

Parameter Type Description
answer string | string[] | number Solution for the contract.
fn string Filename of the contract.
host string Host or IP of the server containing the contract. Optional. Defaults to current server if not provided.
opts CodingAttemptOptions Optional parameters for configuring function behavior.

Returns:

boolean | string

True if the solution was correct, false otherwise. If the returnReward option is configured, then the function will instead return a string. If the contract is successfully solved, the string will contain a description of the contracts reward. Otherwise, it will be an empty string.

Remarks

10 GB