Totally Insane Web-based IDE

By Daniel Miessler on February 28th, 2007: Tagged as Geek | Programming

6 Comments »

  1. That is pretty cool, but I had a few problems with it when I was trying to test it. It seemed to work fine with simple “Hello World” type programs, but as the programs that I tested got more complex, it began to fail. In case you want it, here is my “Result”:

    (08:38:11) : Can’t locate object method “new” via package “Benchmark” (perhaps you forgot to load “Benchmark”?) at /var/www/basic/lib/WPLib.pm line 304.

    I get that when trying to run the following:

    !usr/bin/perl

    use strict;

    my $x; my $count; my @y; my $y;

    sub foo{ $count ; if($count’2′){@y[$count] = @y[($count-1)] @y[($count-2)];} if($count; if($x=~m/[0-9] / && $x0){foo();} elsif($x>20||$x

    I have tried to remove the strict module and all of my “my” statements, but nothing seems to work. Still, this seems to be a new project and I am sure that as time passes, more and more support will be available and more and more language functionality will be supported. I am pretty excited to see what this project will develop into. Thanks for the heads up!

    Comment by brad — 2/28/2007 @ 8:47 am

  2. sorry, forgot to escape my &lt & &gt haracters.

    !usr/bin/perl

    use strict;

    my $x; my $count; my @y; my $y;

    sub foo{ $count ; if($count&lt=$x){

                if($count=='1'){@y[$count]='0';}
                if($count=='2'){@y[$count]='1';}
                if($count&gt'2'){@y[$count] = @y[($count-1)] @y[($count-2)];}
                if($count&lt$x){foo();}
    
                elsif($count==$x){
                        foreach $y(@y){print $y." ";}
    
                        print "\n\n";
                        @y=();
                        main();
                }
        }
    

    }

    sub main{ $count=0; print “Please enter a number [1..18] to continue\n:”; $x = &lt> if($x=~m/[0-9] / && $x&lt=20 && $x&gt0){foo();} elsif($x&gt20||$x&lt0){main();} else{exit 0;} }

    main();

    Comment by brad — 2/28/2007 @ 8:52 am

  3. I noticed an error or two in your perl, but it could just be me.

    You’ve got an extra curly bracket (’}') at the end of the function definition for foo().

    Also, the line below doesn’t seem right. first, I think you need to use dollar signs instead of at symbols. Second, I think there’s supposed to be an operation of some sort between “$y[($count-1)]” and “$y[($count-2)]“.

    if($count>’2′){@y[$count] = @y[($count-1)] @y[($count-2)];}

    Comment by Tim — 2/28/2007 @ 3:02 pm

  4. Tim, you are completely correct on the second part (there is supposed to be a addition sign in there). There is some other code that is cut as well, but this is actually a working Perl script when completely intact. All it does is find the first >i>n numbers of the Fibonacci sequence where the user inputs n, but when I can manage to get the code together, it does work. =) The @ is just the list and the [blah] is an element of that list. I was just playing around by writing it that way. It is mostly all out of whack b/c I am giving this to my interviewees(sp?) to hand trace as one of my tests / interview questions for the positions that I am hiring for. I want to make sure that they can hand trace code, so I have bad names for the vars and some strange notation (as well as no comments) to try to throw them off and at least challenge them slightly. If you want the complete code, though, I would be happy to mail the correct .pl file to you.

    Comment by brad — 2/28/2007 @ 8:09 pm

  5. I just felt like being a code nazi.

    I wrote it out and corrected it myself.

    Comment by Tim — 2/28/2007 @ 10:05 pm

  6. this is cool..

    check out http://www.createworkspace.com they are building something similar..

    Comment by Zenzic — 3/1/2007 @ 3:07 pm

RSS Feed For This Post...
This Post's TrackBack URI

Leave a Comment...