Code Snippets jq

Short texts jq 🧑‍💻 Code snippets jq ✍️ Reading lists jq 👀

mars rover written in jq

def parse_direction_name: { name: ., ordinal: ( if . == “N” then 0 elif . == “E” then 1 elif . == “S” then 2 elif . == “W” then 3 else error(“invalid rover direction: ” + .) end ), }; def parse_direction_ordinal: { ordinal: ., name: ( if . == 0 then “N” elif […]