It's not a fully stupid idea, many rules can be automated and indeed have already been. The things that courts still have to decide manually are the leftovers that require more human judgment.
Edit: Consider the following words included in law.
“reasonable” “reckless” “due care”
Ditto with alcohol laws -18 there-. Selling a cyder to a 17 + 11 months guy would have a much smaller fine than a hard liquor to a 14yo.
The reverse it's true, too. 14yo are the minimum age to be legally punished. If you are 13 and barely stole some $20 Steam card -if any- you just got sentenced to spend your formative years in a juvenile center.
But, if you are 13yo gang member and you have a longass list of both petty and hard crimes and the last one has been a bloody crime with serious injuries or homicide... you can be sent as an exception to an adult prison because your mentality and mindset are not the ones from the early teens.
Especially if your body it's really developed for your age and you basically commanded mini-clans as the ones you can see in Ireland, Italy and the like. When you can smack down adults at age 13 and even ilegally drive a car, the Spanish constitution wont save you. Ultimately you must -and can- be trialed as an adult but also be able to finish the mandatory education years until you hit 16. Not easy, of course, but sending these kind of people to juvenile centers just generates more thugs than anything else.
If this is difficult for humans, imagine that for software with exact constraints.
Certain laws, like parts of tax law may be possible to turn into code, like percentages and deadlines, but even those often carry natural language conditions that can't be evaluated so easily. Seriously, try it.
Turns out, ambiguity is an intentional communicative tool.