local delay = 1

function checkSignal()
  return (redstone.getInput("right"))
end

function handleOutput()
  redstone.setOutput("left", true)
  sleep(delay)
  redstone.setOutput("left", false)
  sleep(delay)
end

function terminateOutput()
  redstone.setOutput("left", false)
end

while checkSignal() do
  handleOutput()
end

terminateOutput()
