Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ,[>--[<++>+++++++]<+[>+>+<<-]>[<+>-]+>[<->[-]]<[[,----------]]<>>--[>+
- <++++++]<<--------[>+>+<<-]>[<+>-]+>[<->[-]]<[->>.<<]>>+<<<-[>+>+<<-]>
- [<+>-]+>[<->[-]]<[->>.<<]>>+<<<-[>+>+<<-]>[<+>-]+>[<->[-]]<[->>.<<]>>+
- <<<-[>+>+<<-]>[<+>-]+>[<->[-]]<[->>.<<]>>++++++++++++++<<<------------
- --[>+>+<<-]>[<+>-]+>[<->[-]]<[->>.<<]>>++<<<--[>+>+<<-]>[<+>-]+>[<->[-
- ]]<[->>.<<]>++++[>+++++++<-]>+<<++++[<------->-]<-[>+>+<<-]>[<+>-]+>[<
- ->[-]]<[->>.<<]>>++<<<--[>+>+<<-]>[<+>-]+>[<->[-]]<[->>.<<]>>[-]<<<,]
- ,[
- #subtract #
- >--[<++>+++++++]<+
- #strip comments
- [>+>+<<-]>[<+>-]+>[<->[-]]<[[,----------]]<
- #put '+' in 4th cell
- >>--[>+<++++++]<<
- #+
- --------
- [>+>+<<-]>[<+>-]+>[<->[-]]<[->>.<<]>>+<<<
- #,
- -
- [>+>+<<-]>[<+>-]+>[<->[-]]<[->>.<<]>>+<<<
- #-
- -
- [>+>+<<-]>[<+>-]+>[<->[-]]<[->>.<<]>>+<<<
- #.
- -
- [>+>+<<-]>[<+>-]+>[<->[-]]<[->>.<<]>>++++++++++++++<<<
- #<
- --------------
- [>+>+<<-]>[<+>-]+>[<->[-]]<[->>.<<]>>++<<<
- #>
- --
- [>+>+<<-]>[<+>-]+>[<->[-]]<[->>.<<]>++++[>+++++++<-]>+<<
- #[
- ++++[<------->-]<-
- [>+>+<<-]>[<+>-]+>[<->[-]]<[->>.<<]>>++<<<
- #]
- --
- [>+>+<<-]>[<+>-]+>[<->[-]]<[->>.<<]>>[-]<<<
- ,]
- $/="nn";
- chomp($prog = <>);
- for(1..length($prog)){
- $rev.=chop $prog;
- }
- #print$rev;
- for(1..length($rev)){
- $temp = chop$rev;
- if ($temp eq '"'){
- if($quote == 0){$quote = 1}
- else{$quote = 0}
- }
- if($temp eq '#' && $quote == 0){$comment = 1}
- if($temp eq "n"){
- $comment = 0;
- }
- if($comment != 1){
- $prog.=$temp;
- }
- }
- for(1..length($prog)){
- $rev.=chop $prog;
- }
- for(1..length($rev)){
- $temp = chop$rev;
- if ($temp eq ";" || $temp eq "}" || $temp eq ")" || $temp eq "=" || $temp eq "{"){
- $ws = 2;
- }
- if(($temp eq "n" || $temp eq " ") && $ws != 0){$ws = 1}elsif($ws==1){$ws=0}
- if($ws != 1){
- $prog.=$temp;
- }
- }
- print$prog;
- for(1..10) {
- print "Hello, World!";#prints hello world
- print ($n = <>); #prints "#"
- }
- for(1..10){print "Hello, World!";print ($n =<>);}
- #!/usr/bin/env perl
- use strict;
- use warnings;
- my $string_re = qr/"(?:\[btnfr"'\]|\(?:[0-3][0-7][0-7]|[0-7]{1,2})|\u+[0-9a-fA-F]{4}|[^rn\"])*"/;
- my @lines = <>;
- my @strings = ();
- # First, replace strings with placeholders. Strings suck REALLY hard when replacing.
- map {
- while (m/$string_re/) {
- s//"