Shuffle
A shuffle line randomly changes the order of lines below.
Shuffling affects all kinds of lines: paragraphs, links, and pick lines etc.
Shuffle lines
A simple shuffle line starts with a :SHUFFLE: tag followed by a number. The number points out how many lines below the shuffle line shall be shuffled.
These are my favorite pizzas ordered from awesome to marvellous:
:SHUFFLE: 3
Pizza Aglio
Pizza Piccante
Pizza Salami
In this example the shuffle line randomly changes the order of three paragraphs. Each paragraph can either jump to a new position or stay where it originally was.
Hit refreshupdate a few times and see for yourself.
If you write a shuffle line with only a :SHUFFLE: tag and nothing else, Hypstory will behave as if there were no shuffle line at all.
Workflow tip: A short tag for shuffle lines is :SH:.
Shuffle groups of lines
Sometimes you want to randomly rearrange groups of lines. In these cases specify the number of lines in each group.
Pizza should be ranked along the following properties:
:SHUFFLE: 2 2 1
* chewiness
(category suggested by San Holo)
* pizzity
(the essence of being a pizza)
* taste
Here, groups of lines get shuffled around. A figure after the :SHUFFLE: tag represents the size of each group. Consequently, the number of figures points out how many groups this shuffle line affects. Separate these figures with spaces like above or put them in parentheses: :SHUFFLE: (2) (2) (1).
Just like before, each group can remain in its position or change it.
The shuffle line from the first section (:SHUFFLE: 3) can also be written with this group notation: :SHUFFLE: 1 1 1. Effectively, it means: "Shuffle three groups of one line each."
Workflow tip: Make sure you get a good grasp of how this group notation works. You will encounter it again with pick lines and randomize lines.
Specify shuffle behavior
The shuffle line knows three keywords that influence how it shuffles lines or groups of lines:
- keep – group must keep its original position
- change – group must change its position
- flexible – group can keep or change its position
Flexible is the default behavior. It applies to all lines or groups for which no other keyword is specified.
Shuffle behavior of lines
When you use the shorthand for shuffling a number of single lines you can specify only one keyword that applies to each line.
"You want to make your own pizza?" asks Alfonso doubtfully. "Well, then let me show you how to do it properly. First you make the dough nice and thin,
:SHUFFLE: 4|keep
then you put the tomato sauce,
then you put the salami,
then you put the cheese,
then you sprinkle some oregano,
and then you bake it for six minutes."
"Sounds like there's really only one way to do it," you sum up Alfonso's instructions.
No matter how often you hit update, Alfonso will not change his mind about how a pizza has to be made. All steps stay in their place because of the keep keyword.
Practice tip: Change the keyword in the shuffle line above from keep to change, hit update and see what happens.
Shuffle behavior of groups
With the group notation you can specify the keyword for each group separately. In the following example each group has one line only.
:SHUFFLE: 1|keep 1|change 1|keep 1|change 1|keep 1|change
Francesca likes
Francesca's pizza
Alfonso likes
Alfonso's pizza
I like
My pizza
In this example, there are six groups with one line each. The keywords are set separately to create a specific behavior: Oddly numbered groups stay in place, evenly numbered groups change positions randomly.
Because the change keyword forces groups to leave their position, no person ever prefers their own pizza over the others'.
Practice tip: Change the shuffle line in the example above to :SHUFFLE: (2|change) (2|change) (2|change), hit update and see what happens.