25 lines
858 B
Text
25 lines
858 B
Text
# each.ludic - a step every player must meet in their own pack: how many seats are taken, how
|
|
# many of them carry it, and which do not
|
|
export function steps_players(steps_st: StepsState) -> int {
|
|
var n = 0
|
|
for p in 0 .. steps_st.steps__players { if StepsWorld.present(p) { n += 1 } }
|
|
return n
|
|
}
|
|
|
|
# how many seats taken have step i's thing (seat 0 counted live)
|
|
export function steps_each(steps_st: StepsState, i: int) -> int {
|
|
var n = 0
|
|
for p in 0 .. steps_st.steps__players {
|
|
if StepsWorld.present(p) and steps__share(steps_st, p, i) != 0 { n += 1 }
|
|
}
|
|
return n
|
|
}
|
|
|
|
# the seats that do not have it yet
|
|
export function steps_lacking(steps_st: StepsState, i: int) -> []int {
|
|
let out = new []int
|
|
for p in 0 .. steps_st.steps__players {
|
|
if StepsWorld.present(p) and steps__share(steps_st, p, i) == 0 { push(out, p) }
|
|
}
|
|
return out
|
|
}
|