sorcery  Diff

Differences From Artifact [e883d78392]:

To Artifact [64ce434f04]:

  • File lib/str.lua — part of check-in [3f6a913e4e] at 2020-09-29 12:40:28 on branch trunk — * remove former hacky registration system, replace with consistent and flexible API; rewrite metal/gem generation to take advantage of this new API; tweaks to init system to enable world-local tweaks to lore and sorcery behavior * initial documentation commit * initial steps towards calendar - add default date format, astrolabe; prepare infra for division/melding/transmutation spells, various tweaks and fixes (user: lexi, size: 2303) [annotate] [blame] [check-ins using]

9
10
11
12
13
14
15












16
17
18
19
20
21
22
	['\xf2'] = '\2';
	['\xf3'] = '\3';
}
return {
	capitalize = function(str)
		return string.upper(string.sub(str, 1,1)) .. string.sub(str, 2)
	end;













	rand = function(min,max)
		if not min then min = 16  end
		if not max then max = min end
		local str = ''
		local r_int   =            0x39 - 0x30
		local r_upper = r_int   + (0x5a - 0x41)







>
>
>
>
>
>
>
>
>
>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
	['\xf2'] = '\2';
	['\xf3'] = '\3';
}
return {
	capitalize = function(str)
		return string.upper(string.sub(str, 1,1)) .. string.sub(str, 2)
	end;

	explode = function(str,delim)
		local i = 1
		local tbl = {}
		repeat
			local ss = string.sub(str, i)
			local d = string.find(ss, delim, 1, true) or string.len(ss)+1
			tbl[#tbl+1] = string.sub(ss,1,d-1)
			i = i + d 
		until i > string.len(str)
		return tbl
	end;

	rand = function(min,max)
		if not min then min = 16  end
		if not max then max = min end
		local str = ''
		local r_int   =            0x39 - 0x30
		local r_upper = r_int   + (0x5a - 0x41)