Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <Eigen/Dense>
#include <concepts>
namespace Eigen {
template <int D, typename Derived>
inline auto& get(Eigen::DenseCoeffsBase<Derived, WriteAccessors>& p) { return p.coeffRef(D); }
template <int D, typename Derived>
inline const auto get(const Eigen::DenseCoeffsBase<Derived,ReadOnlyAccessors>& p) { return p.coeff(D); }
@pfmoore
pfmoore / factorio-recipe-parser.lua
Last active July 16, 2024 16:50
Parse the Factorio recipe files to create a CSV of recipes
data = {}
data["extend"] = function (data, t)
for n, recipe in ipairs(t) do
for i, component in ipairs(recipe["ingredients"]) do
cname = component[1] or component["name"]
camt = component[2] or component["amount"]
print('"' .. recipe["name"] .. '","' .. cname .. '",' .. camt)
end
end
end