Forum:Produce range from two variables

I'm trying to produce a map of minimum growing temparatures for WikiGardener. The editor can enter minimum and maximum temperature zones (0-12) to indicate what zones a plant can survive in. But I need to produce a range from that in a table.

E.g. If the user enters a min of 4 and a max of 8, I need to be able to clarify that 4, 5, 6, 7 and 8 should be included such that the table has all 12 cells, but only those cells are coloured.

The most obvious way would appear to be, for each cell, to evaluate:

and

For each cell, but the  funcion described in wikipedia just returns.

Performing this function with  functions would take masses of code. Am I using the function wrong, or is it not available on wikia? Any other ideas how to calculate this? Thanks Ollie Martin  08:14, September 18, 2010 (UTC)
 * If you put the code in a template, and then add the template to a page, it'll work (i.e. this includes this with no problems], however - on the template page, it won't (this is annoying). You could be neat and cover it in #iferror - or you could just not bother, and accept that the template page will look messy. -- Random Time  09:43, September 18, 2010 (UTC)


 * Also, try to use default values for parameters, like instead of  --Ciencia Al Poder (talk) -WikiDex 10:59, September 18, 2010 (UTC)


 * Outstanding! Thank you. I hadn't appreciated the default parameter value functionality before so thanks Ciencia Al Poder. You were right too RandomTime, of course the problem doesn't appear on the template either if I use the default parameters. If you're interested, it's implemented here on the right-hand side titled 'Ideal Hardiness Zones' Ollie Martin  12:31, September 18, 2010 (UTC)
 * Thanks Ciencia, I had no idea that would give bar as a default value. I blame MediaWiki documentation -- Random Time  18:46, September 19, 2010 (UTC)