- SEE ALSO
- COPYRIGHT AND LICENSE
Language::Befunge::lib::SUBR - subroutines extension
The SUBR fingerprint (0x53554252) allows to use subroutines within befunge.
Create a new SUBR instance.
- J( $vector )
$vectorfrom the stack, and jump inconditionally to this location. The velocity will be forced to (1,0) (or the equivalent for other dimensions).
- ($from, $velocity, @stack) = C( $vector, $count )
Call a subroutine. In details, pop a
$vectorfrom the stack. Then pop
$countelements from the stack, push current position, current velocity and the
$countelements popped back on the stack. Then jump to the
$vectoraddress with a velocity of (1,0) (or the equivalent for other dimensions). This function is supposed to be called in conjunction with
- (@stack) = R($from, $velocity, @stack, $count)
Return from subroutine (supposed to be called after a call to
C). Pop a
$countfrom the stack, then
$countelements from the stack. Pop then 2 vectors, and push back the
$countelements on the stack. Then restore the velocity from the first vector popped, and jump back to address it went from (the second vector popped).
J pop a vector from the stack to jump to this address. However, the vector popped can be either absolute or relative to the storage offset. Default mode is absolute addressing, but one can switch with the following functions:
This software is copyright (c) 2003 by Jerome Quelin.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.