Procedure/es: Difference between revisions
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
Line 28: | Line 28: | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
[[File: | [[File:call_example.gif|alt=Procedure example gif|thumb]] | ||
[[File:procedure_example.png|alt=Procedure example code|thumb]] | [[File:procedure_example.png|alt=Procedure example code|thumb]] | ||
</div> | </div> |
Latest revision as of 18:37, 16 August 2023
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:
- in the “name” box, enter a name for the procedure
- choose the desired return statement from the drop down menu
Example
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.’