Why not? Natural selection made something human-level intelligent: us. Silicon certainly isn’t worse at information processing than salt gradients in neurons. It’s far better.
At the very least, it is possible to simulate a human brain on a computer. We do not yet have the scanning technology to get a good enough image of the brain in order to replicate it, but armed with that information, it is absolutely possible to recreate the functionality on a machine.
In any case, there is absolutely code that could choose and execute effective actions in pursuit of a goal, given data about its surroundings.