Skip to content

Break actions when they need too many conditions #31

Description

@MikeTaylor

At present, if an action or occurrence has too many instructions associated with it, the ScottKit compiler will automatically break it into a sequence of actions, all but the last finishing with an inserted continue.

We also need to do something analogous when we have an action or occurrence with too many conditions. If we use something like

action TO RAIL when carried rope and flag 3 and at balcony
	clear_flag 3
	destroy rope
	drop ropetied
	print "OK."
	look

saying:

scottkit/lib/scottkit/compile.rb:463:in `block in generate_code': condition has 6 conditions (RuntimeError)

But you can work around that by inserting continue occur 0% between the second and third actions.

The compiler should do this for you.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions