Skip to content

Commit 25e33e1

Browse files
committed
regex index
1 parent b78432e commit 25e33e1

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

scripts/pingpong.coffee

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = (robot) ->
3535

3636

3737
show_player_stats = (msg) ->
38-
player = msg.match[0]
38+
player = msg.match[1]
3939
msg.send player
4040

4141
wins = 0
@@ -53,12 +53,10 @@ show_player_stats = (msg) ->
5353

5454

5555
show_match_stats = (msg) ->
56-
player1 = msg.match[0]
56+
player1 = msg.match[1]
5757
player2 = msg.match[2]
5858
msg.send player1
5959
msg.send player2
60-
msg.send msg.match[1]
61-
6260

6361
wins = 0
6462
redisClient.hget player1, player2, (err, value) ->
@@ -72,7 +70,7 @@ show_match_stats = (msg) ->
7270

7371

7472
store_results = (msg) ->
75-
player1 = msg.match[0]
73+
player1 = msg.match[1]
7674
player2 = msg.match[2]
7775

7876
redisClient.hincrby(player1, player2, 1)

0 commit comments

Comments
 (0)