Execute Brain****/Perl: Difference between revisions
Content added Content deleted
Underscore (talk | contribs) (Created page.) |
Underscore (talk | contribs) (Cleaned up scoping of $input_buffer) |
||
Line 39: | Line 39: | ||
']' => sub { $cmd = pop(@loops) - 1 }); |
']' => sub { $cmd = pop(@loops) - 1 }); |
||
$ |
{my $input_buffer = ''; # Where we store each line of input. |
||
sub get_input |
sub get_input |
||
# Gets one character of input and returns its numeric value. |
# Gets one character of input and returns its numeric value. |
||
{$input_buffer or $input_buffer = <STDIN>; |
|||
return defined($input_buffer) |
|||
? ord substr($input_buffer, 0, 1, '') |
|||
⚫ | |||
? ord substr($input_buffer, 0, 1, '') |
|||
⚫ | |||
sub jump |
sub jump |