--lua module "utils" for random utilities
if utils then return end --avoid loading twice
utils = {}

function utils.getSideOf(name) --get which side, if any, a peripheral p is connected to
	local sides = peripheral.getNames()
	for i = 1, #sides do
	    if peripheral.getType(sides[i]) == name then
			--found it!
	        return sides[i]
	    end
	end
end

return utils