@Override public void execute(ChipState chip, boolean[] state, WithLineInfo<String>[] code) throws PlcException { boolean[] tt = new boolean[32]; boolean a = chip.getInputCount() > 0 && chip.getInput(0); boolean b = chip.getInputCount() > 1 && chip.getInput(1); boolean c = chip.getInputCount() > 2 && chip.getInput(2); for (int i = 0; i < chip.getOutputCount(); i++) if (i < code.length) { Boolean r = executeFunction(i, state, tt, code, a, b, c, new boolean[0], new int[1], 0); if (r == null) { chip.setOutput(i, false); } else { chip.setOutput(i, r); } } else { chip.setOutput(i, false); } }