Usually in single-player poker (such as the one you can find on a slot machine) the payout is based on the TYPE of hand you have (Flush vs. Straight) without regard to the actual ranking of the cards involved in the hand (pair of Jacks pays the same as pair of Aces). Also, the amount of the payout grows non-linearly, so it is often worthwile taking higher risk for higher reward. For example, if I have a pair of Aces and K,Q,J of the same suit as one of the Aces it's certainly worthwhile dropping an Ace for a chance of getting a straight flush. You only have 1/47 chance of getting it, but if it offers 250/1 payout then it's well worth the risk. You also have a pretty good chance of getting a flush of a straight. Keeping the pair of Aces may give you higher probability of improving your hand to some other hand, but it prevents you from getting a straight flush.
Since you ranked all winning hands linearly the results of the possible outcomes are not typical for the poker and therefore the experience and intuition are not of much help. Also, the picks made by your program as optimal for any given hand will not be optimal in a real game with non-linear payout schedule.