Try: Difference between revisions

From Wiki of ZZT
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:try}} '''#try''' (Shortened: '''?''') is a ZZT-OOP movement command which attempts to move an object one step in a given direction. Unlike...")
 
(No difference)

Latest revision as of 22:19, 11 February 2021

#try (Shortened: ?) is a ZZT-OOP movement command which attempts to move an object one step in a given direction. Unlike #go, #try will not block program execution if the object is incapable of moving to its destination.

If #try is unsuccessful, an optional command can be executed, similar to #give and #take. This is not supported with the shortened variant.

Syntax

Full form: #try <direction> [<failure_command>]

Shortened form: ?<direction>