(set:$shuffled_suspects to (a:))
(set:$initial_rooms to (a:"kitchen","ball room","conservatory","small dining room","cellar","grand foyer","great hall","music room","game room","library","study","parlor"))
(set:$shuffled_rooms to (a:))
(goto:"shuffle suspects")(set:$temp to (either:...$initial_suspects))
(set:$initial_suspects to $initial_suspects-(a:$temp))
(set:$shuffled_suspects to $shuffled_suspects+(a:$temp))
(if:length of $initial_suspects > 1)[(goto:"shuffle suspects")](elseif:length of $initial_suspects is 1)[(set:$shuffled_suspects to $shuffled_suspects+(a:1st of $initial_suspects))(set:$initial_suspects to (a:))(goto:"shuffle rooms")]
<!-- See note at shuffle rooms -->(set:$temp to (either:...$initial_rooms))
(set:$initial_rooms to $initial_rooms-(a:$temp))
(set:$shuffled_rooms to $shuffled_rooms+(a:$temp))
(if:length of $initial_rooms > 1)[(goto:"shuffle rooms")](elseif:length of $initial_rooms is 1)[(set:$shuffled_rooms to $shuffled_rooms+(a:1st of $initial_rooms))(set:$initial_rooms to (a:))(goto:"assign initial alibis")]
<!-- Should be possible just to do with the (shuffled:) macro but I couldn't get it working, so this is a work-around. This passage loops round, picking a random item to delete from $initial_rooms and add to $shuffled_rooms on each loop. The if at the end is because the (either:) macro won't work with just one item -->{(set:$character1 to (datamap:"name", (1st of $shuffled_suspects), "alibi_location", (1st of $shuffled_rooms), "location", (display:"room select"), "alibi_companion", "nobody"))
(set:$character2 to (datamap:"name", (2nd of $shuffled_suspects), "alibi_location", (1st of $shuffled_rooms), "location", (display:"room select"), "alibi_companion", "nobody"))
(set:$character3 to (datamap:"name", (3rd of $shuffled_suspects), "alibi_location", (2nd of $shuffled_rooms), "location", (display:"room select"), "alibi_companion", "nobody"))
(set:$character4 to (datamap:"name", (4th of $shuffled_suspects), "alibi_location", (2nd of $shuffled_rooms), "location", (display:"room select"), "alibi_companion", "nobody"))
(set:$character5 to (datamap:"name", (5th of $shuffled_suspects), "alibi_location", (3rd of $shuffled_rooms), "location", (display:"room select"), "alibi_companion", "nobody"))
(set:$character6 to (datamap:"name", (6th of $shuffled_suspects), "alibi_location", (3rd of $shuffled_rooms), "location", (display:"room select"), "alibi_companion", "nobody"))
(set:$character7 to (datamap:"name", (7th of $shuffled_suspects), "alibi_location", (4th of $shuffled_rooms), "location", (display:"room select"), "alibi_companion", "nobody"))
(set:$character8 to (datamap:"name", (8th of $shuffled_suspects), "alibi_location", (4th of $shuffled_rooms), "location", (display:"room select"), "alibi_companion", "nobody"))
(set:$murderer to (datamap:"name", (9th of $shuffled_suspects), "alibi_location", (display:"room select"), "location", (display:"room select"), "alibi_companion", (either:...$shuffled_suspects)))
(set:$character1's alibi_companion to $character2's name)
(set:$character2's alibi_companion to $character1's name)
(set:$character3's alibi_companion to $character4's name)
(set:$character4's alibi_companion to $character3's name)
(set:$character5's alibi_companion to $character6's name)
(set:$character6's alibi_companion to $character5's name)
(set:$character7's alibi_companion to $character8's name)
(set:$character8's alibi_companion to $character7's name)
}Perhaps (print:$character1's name) was in the (print:$character1's alibi_location) with (print:$character1's alibi_companion) all evening.
Perhaps (print:$character2's name) was in the (print:$character2's alibi_location) with (print:$character2's alibi_companion) all evening.
Perhaps (print:$character3's name) was in the (print:$character3's alibi_location) with (print:$character3's alibi_companion) all evening.
Perhaps (print:$character4's name) was in the (print:$character4's alibi_location) with (print:$character4's alibi_companion) all evening.
Perhaps (print:$murderer's name) was in the (print:$murderer's alibi_location) with (print:$murderer's alibi_companion) all evening.
Perhaps (print:$character5's name) was in the (print:$character5's alibi_location) with (print:$character5's alibi_companion) all evening.
Perhaps (print:$character6's name) was in the (print:$character6's alibi_location) with (print:$character6's alibi_companion) all evening.
Perhaps (print:$character7's name) was in the (print:$character7's alibi_location) with (print:$character7's alibi_companion) all evening.
Perhaps (print:$character8's name) was in the (print:$character8's alibi_location) with (print:$character8's alibi_companion) all evening.
[[break up pairs]](either:"kitchen","ball room","conservatory","small dining room","cellar","grand foyer","great hall","music room","game room","library","study","parlor"){(set:$character1's alibi_location to 5th of $shuffled_rooms)
(set:$character1's alibi_companion to "nobody but herself, she's afraid,")
(set:$character2's alibi_location to 6th of $shuffled_rooms)
(set:$character2's alibi_companion to "nobody but herself, she's afraid,")
(if:(random:1,3) is 1)[(set:$murderer's alibi_companion to "nobody but herself, she's afraid,")]
(if:$character1's alibi_companion is "nobody but herself, she's afraid," and $murderer's alibi_companion is "nobody but herself, she's afraid,")[(if:(random:1,2) is 1)[(set:$murderer's alibi_companion to $character1's name)](else:)[(set:$murderer's alibi_location to 2nd of $shuffled_rooms)]]
<!-- if character1 and character2 are not together, and the murderer is also claiming to be alone, there is a risk that the murderer's story will not be disprovable. The above set of if statements ensure that if character1 and character2 are not together, the murderer will either claim to be with character1 or claim to be by herself in room 2 (occupied by character3 and character4). This isn't very elegant, but at least it creates some variation. -->
}You meet (print:$character1's name) in the (print:$character1's location). She claims she was in the (print:$character1's alibi_location) with (print:$character1's alibi_companion) all evening.
You meet (print:$character2's name) in the (print:$character2's location). She claims she was in the (print:$character2's alibi_location) with (print:$character2's alibi_companion) all evening.
You meet (print:$character3's name) in the (print:$character3's location). She claims she was in the (print:$character3's alibi_location) with (print:$character3's alibi_companion) all evening.
You meet (print:$character4's name) in the (print:$character4's location). She claims she was in the (print:$character4's alibi_location) with (print:$character4's alibi_companion) all evening.
You meet (print:$murderer's name) in the (print:$murderer's location). She claims she was in the (print:$murderer's alibi_location) with (print:$murderer's alibi_companion) all evening.
You meet (print:$character5's name) in the (print:$character5's location). She claims she was in the (print:$character5's alibi_location) with (print:$character5's alibi_companion) all evening.
You meet (print:$character6's name) in the (print:$character6's location). She claims she was in the (print:$character6's alibi_location) with (print:$character6's alibi_companion) all evening.
You meet (print:$character7's name) in the (print:$character7's location). She claims she was in the (print:$character7's alibi_location) with (print:$character7's alibi_companion) all evening.
You meet (print:$character8's name) in the (print:$character8's location). She claims she was in the (print:$character8's alibi_location) with (print:$character8's alibi_companion) all evening.
[[restart|determine initial alibis]](print:$initial_suspects.join(", "))
(print:$initial_suspects's 1st) - [rename]<rename_1st|
(print:$initial_suspects's 2nd) - [rename]<rename_2nd|
(print:$initial_suspects's 3rd) - [rename]<rename_3rd|
(print:$initial_suspects's 4th) - [rename]<rename_4th|
(print:$initial_suspects's 5th) - [rename]<rename_5th|
(print:$initial_suspects's 6th) - [rename]<rename_6th|
(print:$initial_suspects's 7th) - [rename]<rename_7th|
(print:$initial_suspects's 8th) - [rename]<rename_8th|
(print:$initial_suspects's 9th) - [rename]<rename_9th|
[[Start all over->setup initial characters]]
[[All done!->determine initial alibis]]
(click:?rename_1st)[(set:$initial_suspects to ($initial_suspects-(a:1st of $initial_suspects)))(set:$initial_suspects to $initial_suspects+(a:(prompt:"What name?")))(goto:"rename characters")]
(click:?rename_2nd)[(set:$initial_suspects to ($initial_suspects-(a:2nd of $initial_suspects)))(set:$initial_suspects to $initial_suspects+(a:(prompt:"What name?")))(goto:"rename characters")]
(click:?rename_3rd)[(set:$initial_suspects to ($initial_suspects-(a:3rd of $initial_suspects)))(set:$initial_suspects to $initial_suspects+(a:(prompt:"What name?")))(goto:"rename characters")]
(click:?rename_4th)[(set:$initial_suspects to ($initial_suspects-(a:4th of $initial_suspects)))(set:$initial_suspects to $initial_suspects+(a:(prompt:"What name?")))(goto:"rename characters")]
(click:?rename_5th)[(set:$initial_suspects to ($initial_suspects-(a:5th of $initial_suspects)))(set:$initial_suspects to $initial_suspects+(a:(prompt:"What name?")))(goto:"rename characters")]
(click:?rename_6th)[(set:$initial_suspects to ($initial_suspects-(a:6th of $initial_suspects)))(set:$initial_suspects to $initial_suspects+(a:(prompt:"What name?")))(goto:"rename characters")]
(click:?rename_7th)[(set:$initial_suspects to ($initial_suspects-(a:7th of $initial_suspects)))(set:$initial_suspects to $initial_suspects+(a:(prompt:"What name?")))(goto:"rename characters")]
(click:?rename_8th)[(set:$initial_suspects to ($initial_suspects-(a:8th of $initial_suspects)))(set:$initial_suspects to $initial_suspects+(a:(prompt:"What name?")))(goto:"rename characters")]
(click:?rename_9th)[(set:$initial_suspects to ($initial_suspects-(a:9th of $initial_suspects)))(set:$initial_suspects to $initial_suspects+(a:(prompt:"What name?")))(goto:"rename characters")](if:(either:1,2) is 1)[(set:$initial_suspects to (a:"Mrs Raisins","Mrs Pournelle","Mrs Vichy","Colnel Partridge","Mrs Caesar","Mrs Illuminatus","Mrs Froggart","Mrs Widdershins-Mieville","Mrs Cott"))](else:)[(set:$initial_suspects to (a:"Mrs Conservatory","Mrs Great-Hall","Mrs Candlestick","Colnel Revolver","Mrs Lampshade","Mrs Library","Mrs Study","Mrs Lead-Pipe","Mrs Parlor"))]
(goto:"rename characters")