add Def{} helper.

(This uses the debug API.  This particular use seems OK, but maybe
should be abstracted.)
This commit is contained in:
Glenn Maynard
2006-10-09 07:30:48 +00:00
parent 52edd053bd
commit c8e76b5048
2 changed files with 41 additions and 0 deletions
@@ -10,6 +10,15 @@ PLAYER_1 = "PlayerNumber_P1"
PLAYER_2 = "PlayerNumber_P2"
NUM_PLAYERS = #PlayerNumber
function string:find_last( text )
local LastPos = 0;
while true do
local p = string.find( self, text, LastPos+1, true );
if not p then return LastPos end
LastPos = p;
end
end
-- (c) 2006 Glenn Maynard
-- All rights reserved.
--