2021-10-30 12:34:14 -04:00
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home ](./index.md ) > [bitburner ](./bitburner.md ) > [CodingContract ](./bitburner.codingcontract.md ) > [attempt ](./bitburner.codingcontract.attempt.md )
## CodingContract.attempt() method
2021-11-03 00:27:21 -04:00
Attemps a coding contract.
2021-10-30 12:34:14 -04:00
< b > Signature:< / b >
```typescript
2021-11-22 11:36:13 -05:00
attempt(answer: string[] | number, filename: string, host?: string, opts?: CodingAttemptOptions): boolean | string;
2021-10-30 12:34:14 -04:00
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
2021-11-03 00:27:21 -04:00
| answer | string\[\] \| number | Solution for the contract. |
2021-11-22 11:36:13 -05:00
| filename | string | |
2021-11-03 00:27:21 -04:00
| host | string | Host of the server containing the contract. Optional. Defaults to current server if not provided. |
2021-11-03 20:19:52 -04:00
| opts | [CodingAttemptOptions ](./bitburner.codingattemptoptions.md ) | Optional parameters for configuring function behavior. |
2021-10-30 12:34:14 -04:00
< b > Returns:< / b >
2021-11-03 20:19:52 -04:00
boolean \| string
2021-10-30 12:34:14 -04:00
2021-11-03 20:19:52 -04:00
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 contract’ s reward. Otherwise, it will be an empty string.
2021-10-30 12:34:14 -04:00
## Remarks
2021-11-03 00:27:21 -04:00
RAM cost: 10 GB
Attempts to solve the Coding Contract with the provided solution.
2021-10-30 12:34:14 -04:00