NAME
Language::Befunge::LaheySpace - a LaheySpace representation.
SYNOPSIS
DESCRIPTION
CONSTRUCTOR
new( )
Creates a new Lahey Space.
ACCESSORS
Those accessors are private, and are not meant to be used from outside this module (the torus won't enlarge if used directly). You've been warned.
All the following accessors are autoloaded.
xmin( [x] )
Get or set the current minimum x-coordinate of the torus.
xmax( [x] )
Get or set the current minimum x-coordinate of the torus.
ymin( [y] )
Get or set the current minimum y-coordinate of the torus.
ymax( [y] )
Get or set the current minimum y-coordinate of the torus.
PUBLIC METHODS
clear( )
Clear the torus.
store( code, [x, y] )
Store the given code at the specified coordinates. If the coordinates are omitted, then the code is stored at the Origin(0, 0) coordinates.
Return the widht and height of the code inserted.
get_value( x, y )warn "apres: ",$self->xmax,",",$self->ymax,"\n";
Return the number stored in the torus at the specified location. If the value hasn't yet been set, it defaults to the ordinal value of a space (ie, #32).
/!\ As in Befunge, code and data share the same playfield, the number returned can be either an instruction or a data (or even both... Eh, that's Befunge! :o) ).
set_value( x, y, value )
Write the supplied value in the torus at the specified location.
/!\ As in Befunge, code and data share the same playfield, the number stored can be either an instruction or a data (or even both... Eh, that's Befunge! :o) ).
move_ip_forward( ip )
Move the given ip forward, according to its delta.
rectangle( x, y, w, h )
Return a string containing the data/code in the specified rectangle.
PRIVATE METHODS
set_min( x, y )
Set the current minimum coordinates. If the supplied values are bigger than the actual minimum, then nothing is done.
set_max( x, y )
Set the current maximum coordinates. If the supplied values are smaller than the actual maximum, then nothing is done.
enlarge_x( dx )
Enlarge the torus on its x coordinate. If the delta is positive, add columns after the last column; if negative, before the first column; if nul, nothing is done.
enlarge_y( dy )
Enlarge the torus on its y coordinate. If the delta is positive, add lines after the last one; if negative, before the first line; if nul, nothing is done.
AUTHOR
Jerome Quelin, <jquelin@cpan.org>
COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.