createInstruction method
Creates instructions.
Implementation
@override
List<Instruction> createInstruction(TurtleState turtle, Map argv) {
if (commands.isEmpty) return [];
var instructions = <Instruction>[];
for (var i = 0; i < times(Map.from(argv)); i++) {
var copy = Map.from(argv);
copy[repcount] = i + 1;
var list = List<Instruction>.of(commands
.map((command) => command.createInstruction(turtle, copy))
.expand((x) => x));
instructions.addAll(list);
}
return instructions;
}