🎮 play
Setup takes about 10 min (mostly unattendet) for installing Julia, Pluto, and some packages. It requires about 1 GB disk space.
1. Download Julia from the official website and install it with the standard settings
2. Start Julia (e.g. in the Windows Start Menu)
The Julia REPL (a black window) will appear. Please keep this window open until you are done with the simulation.
3. Copy the code below
begin
# Download the notebook into a temporary directory
nb = download("https://raw.githubusercontent.com/frankhuettner/newsvendor/main/game/newsvendorgame.jl", joinpath(mktempdir(), "newsvendorsimulation.jl"))
# Install Pluto
import Pkg; Pkg.add("Pluto")
# Start Pluto and load the notebook
import Pluto; Pluto.run(dismiss_update_notification=true, notebook=nb)
end
4. Paste the code into the Julia REPL
Ctrl+V will not work. Instead, RIGHTCLICK into the Julia REPL window. This will insert the code that you copied above. Then, hit the Enter key to execute the code.
5. Now wait for 10 minutes
Julia will install Pluto and download the simulation. After about 5 minutes, it opens your browser and you see fragments of the simulation. It will install further packages and is finished once the animations stop. Get a ☕ or 🍵 or use your computer for something else while waiting (do not close the Julia window).
6. Play the game and download your score when you finished the game
When you're done (make sure having downloaded your score), you can close of Julia and the browser window.