Skip to content

Commit c1dc320

Browse files
committed
Remove Challenge
1 parent 8fc2ba2 commit c1dc320

File tree

3 files changed

+0
-56
lines changed

3 files changed

+0
-56
lines changed

README.md

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -220,23 +220,6 @@ If you get stuck, here are some **hints**:
220220

221221
With the correct implementation, LiquidJava will report an error in line 11 of [StackExample.java](./src/main/java/com/tutorial/part4/exercise/StackExample.java), since we are trying to pop an element of the stack when it is empty.
222222

223-
### 5. Challenge
224-
225-
> Open [Downloader.java](./src/main/java/com/tutorial/part5/Downloader.java). Your task is to refine the `Downloader` class by replacing the `"true"` refinements with the appropriate ones to ensure the correct behavior of the `start`, `updateProgress`, `complete` and `getFile` methods, using the `progress` ghost variable to keep track of the download progress (from `0` to `100`), and the `waiting`, `downloading` and `completed` states.
226-
227-
You will have to use most of the concepts learned throughout this tutorial, including refinement aliases, state refinements, and ghost variables. The following DFA illustrates the allowed state transitions:
228-
229-
![Downloader DFA](./docs/images/downloader_dfa.png)
230-
231-
If you get stuck, here are some **hints**:
232-
233-
- The refinement alias `Percent` should only allow integers between `0` and `100` and then it should be used to refine the `percentage` parameter of the `updateProgress` method
234-
- You should combine states and ghost variable assertions in the state refinements of the `updateProgress` and `complete` methods using the `&&` operator
235-
- You should define that the new percentage value in the `updateProgress` method should always be greater than the current `progress` ghost variable value
236-
- The `getFile` method should only be called when the download is finished
237-
238-
With the correct implementation, LiquidJava should report an error in line 35, since we are trying to complete the download when the progress is not yet 100%. Simply add a new line that updates the progress to 100 before calling the `complete` method to fix the error.
239-
240223
---
241224

242225
## Quiz

docs/images/downloader_dfa.png

-65.6 KB
Binary file not shown.

src/main/java/com/tutorial/part5/Downloader.java

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)