Chapter II

Shiny Trinkets

  1. Opening Trinket

    Open this site - we’ll be writing and executing all of our code here.

    If this site is already open on the right side of your screen then don’t worry about this.

    You should see something like this:

    Intial Trinket View

    On the left you have the editor, which you will be writing code in.

    Your code will be executed & displayed on the right.

  2. Where We Write Code

    We’ll be writing all of our code inside the editor, below the ‘WRITE YOUR CODE HERE’ comment (on line 17), inside the def setup(game: Game): function.

    Editor View

    With all code you copy from this site, make sure you write it exactly as it is shown. This is important, else your code might not compile and you’ll get an error.

  3. Executing Code

    Click the Run button on the right to execute your code (which currently prints “Hello World!”)

    If you look on the right you’ll see a black square appear for a bit, then below that some text.

    Code Execution

    The ‘Run’ button on the right will disappear after you click it - click the play symbol in the top-left of the editor to execute the code from now on. Running Again