Jump to content

Module:User:Mr rnddude/Sandbox

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mr rnddude (talk | contribs) at 15:13, 19 April 2017 (Will ft come second now or will this still cause an extremely long string.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- This is my module sandbox.
-- Simple repetition module.
-- At Sea level on an ISA day,
-- the pressure should be 1013.2 hPa.
-- I've reduced this to 1013 hPa. Up to
-- 5,000 feet the pressure reduces by 1
-- hPa per 30 feet. Beyond 5,000 feet
-- the rate of reduction decreases. Off
-- the top of my head I can't remember
-- what it is (1/27ft?), but, whatever.

Rho_SL = 1013 -- hPa
Incr = 30 -- feet
MSL = 0 -- feet

local p = {}

function p.Altitude (frame)
	local it = 0
	output = "ft"
	repeat
		it = it + 1
		MSL = MSL + Incr
		output = MSL .. output .. "<br />"
	until (MSL > 5000)
	return 'Altitude' .. "<br />" .. output
end

return p