local PeanoLSystem = {
  axiom = "L",
  rules = {
    L = "LFRFL-F-RFLFR+F+LFRFL",
    R = "RFLFR+F+LFRFL-F-RFLFR"
  },
  eval = function(self, n)
    local source, result = self.axiom
    for i = 1, n do
      result = ""
      for j = 1, #source do
        local ch = source:sub(j,j)
        result = result .. (self.rules[ch] and self.rules[ch] or ch)
      end
      source = result
    end
    return result
  end
}

function Bitmap:drawPath(path, x, y, dx, dy)
  self:set(x, y, "@")
  for i = 1, #path do
    local ch = path:sub(i,i)
    if (ch == "F") then
      local reps = dx==0 and 1 or 3