From 1841a8956bdad976d818c05c18f820410cfce963 Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Wed, 2 Jul 2014 04:41:15 +0000 Subject: [PATCH] Fix number regexes --- spades.awk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spades.awk b/spades.awk index d7e7ac8..5e3be7d 100644 --- a/spades.awk +++ b/spades.awk @@ -461,12 +461,12 @@ sp_state == "play" && # Setup -match($0, /^\.newgame ?([0-9]+) *- *([0-9]+)$/, _arr) { +match($0, /^\.newgame ?([1-9][0-9]*) *- *([1-9][0-9]*)$/, _arr) { if (_arr[2] > _arr[1]) $0 = $1 " " int(rand() * (_arr[2]-_arr[1])+_arr[1]) } -/^\.newgame ?([0-9]+)?$/ { +/^\.newgame ?([1-9][0-9]*)?$/ { if (sp_state != "new") { reply("There is already a game in progress.") } else { @@ -579,7 +579,7 @@ sp_state ~ "(bid|pass|play)" && sp_valid && sp_state == "bid" && -/^\.bid [0-9]+$/ { +/^\.bid [1-9][0-9]*$/ { if ($2 < 0 || $2 > 13) { say("You can only bid from 0 to 13") } else { -- 2.43.2