Class: RBrack

RBrack(locationIndex, pairedLocationIndex)

The right bracket instruction which closes a while loop. This is paired with the left bracket instruction to start the loop.

Constructor

new RBrack(locationIndex, pairedLocationIndex)

Constructor for the Right Bracket instruction
Parameters:
Name Type Description
locationIndex Number The location of the instruction within the unoptimised source code
pairedLocationIndex Number The location of the jump instruction within the unoptimised source code
Source:
See:

Methods

operation(cpu)

Applies the right bracket instruction to the cpu. Only jumps to the start bracket if the value at the current data cell is not zero. Notionally this instruction can be an unconditional jump as the left bracket will do this check anyway. However doing the check at the close saves an additional cpu cycle jumping back and then forward again.
Parameters:
Name Type Description
cpu BFCpu The cpu to apply the operation on.
Source:

Documentation generated by JSDoc 4.0.2 on Sun Feb 08 2026 18:39:26 GMT-0800 (Pacific Standard Time)