Class: BFProgram

BFProgram(instructionsList)

A class containing a list of BFInstructions and the length of the code.

Constructor

new BFProgram(instructionsList)

The constructor for a BF program
Parameters:
Name Type Description
instructionsList Array.<BFInstructions> The instructions list
Source:

Methods

optimiseRLE(opSymbol, opReplacement)

Function to compress program using run length encoding for a given operation. If a run of more than 1 operation is found then the sequence of repeated operations is replaced with the opReplacement with an additional parameter saying how many times it is to be repeated. This function will also adjust the paired instructions to have the correct jump locations. this.instructionsList = ["__ADD_1__", "__ADD_1__","__ADD_1__"]; this.optimiseRLE("__ADD_1__", Add); Updates this.instructionsList to ["__ADD_3__"];
Parameters:
Name Type Description
opSymbol BFInstruction.symbol String of operation symbol
opReplacement char The character to compress
Source:

Documentation generated by JSDoc 4.0.2 on Fri Jun 12 2026 23:36:44 GMT-0700 (Pacific Daylight Time)