bitburner-src/markdown/bitburner.codingcontract.attempt.md
Olivier Gagnon 42518c3caa fix few bugs
2021-11-22 11:36:13 -05:00

36 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- 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.md)
## CodingContract.attempt() method
Attemps a coding contract.
<b>Signature:</b>
```typescript
attempt(answer: string[] | number, filename: string, host?: string, opts?: CodingAttemptOptions): boolean | string;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| answer | string\[\] \| number | Solution for the contract. |
| filename | string | |
| host | string | Host of the server containing the contract. Optional. Defaults to current server if not provided. |
| 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
RAM cost: 10 GB
Attempts to solve the Coding Contract with the provided solution.