Ethics for Robots (How to Design a Moral Algorithm)