os.loadAPI("aturtle")
os.loadAPI("pcons")

function getNumMaterials()
  return 4
end

function getDimensions()
  return 21, 3, 21
end

function getBlockAt(x, y, z)
  if y == 0 then return 1 end
  if y == 1 then
    if x % 2 == z % 2 then
      return 2
    else
      return 1
    end
  end
  if y == 2 then
    if x % 2 == z % 2 then
      return 3
    else
      return 4
    end
  end
end

provider = {
  ["getDimensions"] = getDimensions,
  ["getNumMaterials"] = getNumMaterials,
  ["getBlockAt"] = getBlockAt
}

pcons.run(provider, 5, -3, -10)

