inkle / inkle/ink

Putting logic in shuffles?

Open
#282 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.9k
Forks
540
PR merge metrics
No merged PRs in 30d

Description

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!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.