2021-10-30 18:34:14 +02: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
2022-03-17 21:50:46 +01:00
Attempts a coding contract.
2021-10-30 18:34:14 +02:00
< b > Signature:< / b >
```typescript
2021-11-22 17:36:13 +01:00
attempt(answer: string[] | number, filename: string, host?: string, opts?: CodingAttemptOptions): boolean | string;
2021-10-30 18:34:14 +02:00
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
2021-11-03 05:27:21 +01:00
| answer | string\[\] \| number | Solution for the contract. |
2022-05-24 14:12:49 +02:00
| filename | string | Filename of the contract. |
2021-11-03 05:27:21 +01:00
| host | string | Host of the server containing the contract. Optional. Defaults to current server if not provided. |
2021-11-04 01:19:52 +01:00
| opts | [CodingAttemptOptions ](./bitburner.codingattemptoptions.md ) | Optional parameters for configuring function behavior. |
2021-10-30 18:34:14 +02:00
< b > Returns:< / b >
2021-11-04 01:19:52 +01:00
boolean \| string
2021-10-30 18:34:14 +02:00
2021-11-04 01:19:52 +01: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 18:34:14 +02:00
## Remarks
2021-11-03 05:27:21 +01:00
RAM cost: 10 GB
Attempts to solve the Coding Contract with the provided solution.
2021-10-30 18:34:14 +02:00