2 # This file is part of Language::Befunge.
3 # Copyright (c) 2001-2009 Jerome Quelin, all rights reserved.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the same terms as Perl itself.
10 package Language
::Befunge
;
17 use Language
::Befunge
::Interpreter
;
19 # Public variables of the module.
20 our $VERSION = '4.10';
25 return Language
::Befunge
::Interpreter
->new(@_);
33 Language::Befunge - a generic funge interpreter
38 use Language::Befunge;
39 my $interp = Language::Befunge->new( { file => 'program.bf' } );
40 $interp->run_code( "param", 7, "foo" );
42 Or, one can write directly:
43 my $interp = Language::Befunge->new;
44 $interp->store_code( <<'END_OF_CODE' );
52 Enter the realm of topological languages!
54 This module implements the Funge-98 specifications on a 2D field (also
55 called Befunge). It can also work as a n-funge implementation (3D and
58 This Befunge-98 interpreters assumes the stack and Funge-Space cells
59 of this implementation are 32 bits signed integers (I hope your os
60 understand those integers). This means that the torus (or Cartesian
61 Lahey-Space topology to be more precise) looks like the following:
69 <-----------+----------->
70 -2,147,483,648 | 2,147,483,647
76 This module also implements the Concurrent Funge semantics.
81 =head2 new( [params] )
83 Call directly the C<Language::Befunge::Interpreter> constructor. Refer
84 to L<Language::Befunge::Interpreter> for more information.
93 Write standard libraries.
100 Although this module comes with a full set of tests, maybe there are
101 subtle bugs - or maybe even I misinterpreted the Funge-98
102 specs. Please report them to me.
104 There are some bugs anyway, but they come from the specs:
110 About the 18th cell pushed by the C<y> instruction: Funge specs just
111 tell to push onto the stack the size of the stacks, but nothing is
112 said about how user will retrieve the number of stacks.
116 About the load semantics. Once a library is loaded, the interpreter is
117 to put onto the TOSS the fingerprint of the just-loaded library. But
118 nothing is said if the fingerprint is bigger than the maximum cell
119 width (here, 4 bytes). This means that libraries can't have a name
120 bigger than C<0x80000000>, ie, more than four letters with the first
121 one smaller than C<P> (C<chr(80)>).
123 Since perl is not so rigid, one can build libraries with more than
124 four letters, but perl will issue a warning about non-portability of
125 numbers greater than C<0xffffffff>.
130 =head1 ACKNOWLEDGEMENTS
132 I would like to thank Chris Pressey, creator of Befunge, who gave a
133 whole new dimension to both coding and obfuscating.
142 =item L<http://www.catseye.mb.ca/esoteric/befunge/>
144 =item L<http://dufflebunk.iwarp.com/JSFunge/spec98.html>
151 Jerome Quelin, E<lt>jquelin@cpan.orgE<gt>
153 Development is discussed on E<lt>language-befunge@mongueurs.netE<gt>
156 =head1 COPYRIGHT & LICENSE
158 Copyright (c) 2001-2009 Jerome Quelin, all rights reserved.
160 This program is free software; you can redistribute it and/or modify
161 it under the same terms as Perl itself.