changeset 634:06f5486bfdcb

Plugin tictactoe: fix and simplify cell syntax, closes #768 @15m
author David Demelier <markand@malikania.fr>
date Wed, 14 Mar 2018 13:44:22 +0100
parents c07819d1d306
children b452f5ce799c
files plugins/tictactoe/tictactoe.js tests/src/plugins/tictactoe/main.cpp
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/tictactoe/tictactoe.js	Wed Mar 14 13:12:36 2018 +0100
+++ b/plugins/tictactoe/tictactoe.js	Wed Mar 14 13:44:22 2018 +0100
@@ -330,7 +330,7 @@
     if (!game || !game.isTurn(nickname))
         return;
 
-    var match = /([abc]) ([123])/.exec(message);
+    var match = /^([abc]) ?([123])$/.exec(message.trim());
 
     if (!match)
         return;
--- a/tests/src/plugins/tictactoe/main.cpp	Wed Mar 14 13:12:36 2018 +0100
+++ b/tests/src/plugins/tictactoe/main.cpp	Wed Mar 14 13:44:22 2018 +0100
@@ -92,7 +92,7 @@
 
 BOOST_AUTO_TEST_CASE(win)
 {
-    run({"a 1", "b 1", "a 2", "b 2"});
+    run({"a 1", "b1", "a 2", "b2"});
 
     const auto players = next_players();