Skip to content

Commit 78abf79

Browse files
author
linyisonger
committed
.
1 parent 61147f7 commit 78abf79

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

093.七王五二三-人机对战.html

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,30 @@
9696
}
9797

9898
class Round {
99+
/** @type {Player[]} 玩家*/
100+
players = []
101+
/** @type {PlayerRound[]} 玩家出牌*/
99102
history = []
100-
winner = null
103+
104+
get end() {
105+
if (history.length < playerList.length) return false
106+
let hisLen = this.history.length;
107+
let playerLen = this.players.length;
108+
let lastPlayerRounds = this.history.slice(hisLen - playerLen - 1)
109+
return lastPlayerRounds.every(a => a.pass)
110+
}
111+
112+
get winner() {
113+
114+
}
101115
}
102116

103-
class PlayCards {
117+
class PlayerRound {
104118
player = null
105119
cards = []
120+
get pass() {
121+
return this.cards.length === 0
122+
}
106123
}
107124

108125
class Player {
@@ -175,7 +192,7 @@
175192

176193

177194

178-
195+
179196

180197

181198
/**

0 commit comments

Comments
 (0)