May 2019
Beginner to intermediate
466 pages
10h 44m
English
Let's make sure that, after this refactoring, our code still works as expected, by manually running the code and inspecting the output.
We'll add a new file inside the sixdegrees/ folder, called six_degrees.jl. Looking at its name, you can guess that it will be a plain Julia file and not a module. We'll use it to orchestrate the loading of our game:
using Pkg
pkg"activate ."
include("Wikipedia.jl")
using .Wikipedia
fetchrandom() |> articlelinks |> display
The code is straightforward and minimalistic—we use Pkg to activate the current project. Then, we include the Wikipedia.jl file in the current module, and then we ask the compiler to bring the Wikipedia module into scope. Finally, we use the previously discussed fetchrandom ...
Read now
Unlock full access