Module:JI ratios: Difference between revisions
mNo edit summary |
search-by-params can only search if there is at least an int limit passed in |
||
| Line 101: | Line 101: | ||
-- First get ratios up to an int limit. If no int limit was passed in, it | -- First get ratios up to an int limit. If no int limit was passed in, it | ||
-- will default to the hardcoded default value. | -- will default to the hardcoded default value. | ||
local ratios = p.search_by_int_limit(params["Int Limit"], max_cents) | local ratios = {} | ||
if params["Int Limit"] ~= nil then | |||
p.search_by_int_limit(params["Int Limit"], max_cents) | |||
end | |||
if params["Prime Limit"] ~= nil then | if params["Prime Limit"] ~= nil then | ||
| Line 243: | Line 246: | ||
function p.tester() | function p.tester() | ||
local params = p.parse_search_params("1/1; 2/1") | |||
--ratios = p.search_by_params(params) | --ratios = p.search_by_params(params) | ||
--ratios = p.sort_by_closeness_to_cent_values(ratios, {0, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200}, 15) | --ratios = p.sort_by_closeness_to_cent_values(ratios, {0, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200}, 15) | ||
| Line 249: | Line 252: | ||
--return p.ratios_as_texts(ratios) | --return p.ratios_as_texts(ratios) | ||
local ratios = p.search_by_int_limit(250) | --local ratios = p.search_by_int_limit(250) | ||
return p.ratios_as_text(ratios) .. " " .. #ratios | --return p.ratios_as_text(ratios) .. " " .. #ratios | ||
return params | |||
end | end | ||
return p | return p | ||