int SP = 0; for(unsigned int PC = 0;; PC++){ Read opcode from global/constant if(OPCODE==OPNOP) break; if(optype==leaf) push(trainingdata); else { //function const unsigned int sp1 = stack(SP-1); const unsigned int sp2 = stack(SP-2); SP -= 2; if( optype==OPAND) push(AND(sp1,sp2)); else if(optype==OPOR) push( OR(sp1,sp2)); //NAND, NOR negate top of stack }} |
int SP = 0; for(unsigned int PC = 0;; PC++){ Read opcode from global/constant if(OPCODE==OPNOP) break; top(leaf) = trainingdata; const unsigned int sp1 = stack(SP-1); const unsigned int sp2 = stack(SP-2); top(OPAND) = AND(sp1,sp2); top(OPOR) = OR(sp1,sp2); SP += delta[optype]; stack(SP-1) = top(optype); //NAND, NOR negate top of stack } |