Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Putting logic in shuffles? #282

Open
ClaireHosking opened this issue Mar 9, 2017 · 2 comments
Open

Putting logic in shuffles? #282

ClaireHosking opened this issue Mar 9, 2017 · 2 comments

Comments

@ClaireHosking
Copy link

Hi All,

I'm v new to ink and I'm wondering is there a way to perform logic based on the outcome of a shuffle?

I feel like I'd want to be able to do something like this

VAR holding_item = false
{~He hands me a cup of coffee {holding_item = true} | He hands me the newspaper {holding_item = true}}

Although it feels like the markup is encouraging me to do it more like this

VAR holding_item = false
{~He hands me a cup of coffee {set_bool(holding_item, true)} | He hands me the newspaper  {set_bool(holding_item, true)}}

== function set_bool (bool, state)
~ bool = state

I read all the documentation and searched these topics but I couldn't quite tell what was the proper way to do this. Any help appreciated!

@joningold
Copy link
Member

joningold commented Mar 9, 2017 via email

@ClaireHosking
Copy link
Author

aha! Awesome, thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants