Procedure

From StarLogo Nova Wiki
Revision as of 18:31, 16 August 2023 by Admin (talk | contribs) (duplicate file already uploaded)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Other languages:
The Procedure Block

Usage

Defines a grouping of commands to do a particular function. Select “name” and type over it to rename the procedure.

Syntax

Inputs in this block:

  1. in the “name” box, enter a name for the procedure
  2. choose the desired return statement from the drop down menu

Example

Procedure example gif
Procedure example code

In this version of the snake game, the direction the snake moves is determined by which key is typed. This set of instructions is executed while forever is toggled using the procedure ‘read keyboard input.’