bitburner-src/markdown/bitburner.codingcontract.attempt_1.md

34 lines
1.3 KiB
Markdown
Raw Normal View History

2021-10-30 18:34:14 +02:00
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CodingContract](./bitburner.codingcontract.md) &gt; [attempt](./bitburner.codingcontract.attempt_1.md)
## CodingContract.attempt() method
Attempts to solve the Coding Contract with the provided solution.
<b>Signature:</b>
```typescript
2021-10-30 21:46:34 +02:00
attempt(answer: string | string[] | number, fn: string, host?: string, opts?: CodingAttemptOptions): boolean | string;
2021-10-30 18:34:14 +02:00
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| answer | string \| string\[\] \| number | Solution for the contract. |
| fn | string | Filename of the contract. |
2021-10-30 21:46:34 +02:00
| host | string | Host or IP of the server containing the contract. Optional. Defaults to current server if not provided. |
2021-10-30 18:34:14 +02:00
| opts | [CodingAttemptOptions](./bitburner.codingattemptoptions.md) | Optional parameters for configuring function behavior. |
<b>Returns:</b>
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