GenAction and GenPercept pseudocode

Pseudocode outlines for GenPercept and GenAction functions,
replacing the incorrect / incomplete outlines I wrote before.
Should now be very easy to convert into real code.