content: Would the 10 commandments suffice for a moral code?  No. Giving a computer a moral code is practically impossible because even if you CAN give the computer a moral code you can't be certain how the computer will choose to interpret that moral code. Isaac Asimov did a lot of science fiction books where this was a focus. In his scenario he gave the robots 3 laws.   A robot may not injure a human being or, through inaction, allow a human being to come to harm.    A robot must obey the orders given it by human beings, except where such orders would conflict with the First Law.    A robot must protect its own existence as long as such protection does not conflict with the First or Second Laws      The problem is that even with Laws like this that seem foolproof you can't be sure how the robot will choose to interpret those laws. For example a robot could look at these laws and come to the conclusion that it is now under the obligation to control humanity because it cannot allow a human to die through inaction and humans are a great threat to humanity and therefore the robot is obligated to stop humanity from causing human death.