ExamplesBeginner

Social Boops

Adapt participant-aware Boops that create compatibility scores, customizable actions, and identity-aware results.

Compatibility score

Uses: participants, Rand::pick(), one temporary variable

text {
  let score = Rand::pick(1..=100);
  "@1 and @2 are {score}% compatible."
}
Alice and Mateo are 87% compatible.

The temporary variable prevents a second random roll if you mention the score again later in the same Sugar text.

Customizable action

var intensity: choice = "soft" with {
  input: true,
  choices: ("soft", "hard"),
};
var times = 1 with {
  input: true,
  min: 1,
  max: 10,
};

text "@1 spanks @2 {} {}." with
  if intensity == "hard" then "really hard" else "softly",
  showIf(times > 1, concat(times, pluralize(times, "time")));

Possible results:

Alice spanks Mateo really hard 3 times.
Mateo spanks Alice softly.

showIf() returns empty text when times is 1. concat() joins the number and word with a space.

Choose text for a participant combination

Use when on a text declaration:

text when woman(1) and man(2) {
  "@1 pulls @2 closer."
}

The text is eligible only when participant 1 is a woman and participant 2 is a man.

For a three-participant media rule:

count() == 3 and count("man") == 2 and any("woman")

This requires exactly three participants, exactly two men, and at least one woman.

Pronoun-aware writing

text "@1 takes @2's hand and pulls {} closer, waiting for {} reaction." with them(2), their(2);

The pronoun helpers return words based on participant 2. They default to participant 1 when no number is supplied.

Different reactions from one Boop

text "@1 {} @2." with Rand::pick("kisses", "teases", "bites", "pulls closer");

Use several text when declarations when each result also needs different media. Use Rand::pick() when the variation is small and belongs naturally inside one sentence.