Switch to add/remove instruction mutation
This commit is contained in:
@@ -2,13 +2,13 @@ package gen
|
||||
|
||||
import "github.com/firestuff/subcoding/vm"
|
||||
|
||||
func randInstruction(prog *vm.Program) *vm.Instruction {
|
||||
func RandInstruction(prog *vm.Program) *vm.Instruction {
|
||||
instr := &vm.Instruction{
|
||||
OpCode: randOpCode(),
|
||||
OpCode: RandOpCode(),
|
||||
}
|
||||
|
||||
for i, t := range vm.OperandsByOpCode[instr.OpCode] {
|
||||
instr.Operands[i] = randOperand(prog, t)
|
||||
instr.Operands[i] = RandOperand(prog, t)
|
||||
}
|
||||
|
||||
return instr
|
||||
|
||||
Reference in New Issue
Block a user