return prev
}
+function sp_shuf(i, mixed)
+{
+ asorti(sp_players, mixed, "sp_usort")
+ for (i in mixed) {
+ sp_order[i-1] = mixed[i]
+ sp_players[mixed[i]] = i-1
+ }
+}
+
function sp_deal( shuf)
{
say("/me deals the cards")
sp_order[i] = FROM
say(FROM " joins the game!")
}
- if (sp_state == "join" && sp_turn == 0)
+ if (sp_state == "join" && sp_turn == 0) {
+ sp_shuf()
sp_deal()
+ }
}
/^\.allow \S+$/ {
# | | |- Is not playing for
# | | |- Can no longer play
# | | |- Is not playing for
-auth/auth: . . . . . . . -As
-nope: . . Yauth Nauth . . . .
-a/aa: n . Ya Na d b1 Yauth +As
-b/bb: Ynewgame j Ynope Nnope d b1 . Ah
-c/cc: Nnewgame j Yauth Nauth d b1 . Ad
-d/dd: . j Yauth Nauth d b1 . Ac
+#auth/auth: . . . . . . . -As
+#nope: . . Yauth Nauth . . . .
+#a/aa: n . Ya Na d b1 Yauth +As
+#b/bb: Ynewgame j Ynope Nnope d b1 . Ah
+#c/cc: Nnewgame j Yauth Nauth d b1 . Ad
+#d/dd: . j Yauth Nauth d b1 . Ac
+
+# Test sorting
+a: n j s
+b: . j .
+c: . j .
+d: . j .
# Test scoring
#x: s s s s s s s s s s s s