Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I remember the exact same program for the Apple II in BASIC. I never understood how it worked. (Hey, I was in fourth grade! :) )

    In fact, I thought of that program before you even wrote that paragraph.

    I always wanted to have a program that worked like that but had the ability to "forget." I tried to make that work in a similar (but simpler) BASIC program in eighth grade. Too bad I didn't have Perl and Tie::Hash::Cannabinol then. :)

    --
    J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
    • Found this [csupomona.edu] while Googling. It's Prolog and doesn't learn.
    • Here is the original Animals Integer Basic program source code:

      0 GOTO 1000
      1 REM *************************
      2 REM * *
      3 REM * ANIMALS: *
      4 REM * COPYRIGHT 1978 BY *
      5 REM * APPLE COMPUTER INC. *
      6 REM * *
      7 REM *************************
      100 CUR = 1 : REM HERE IS WHERE PROGRAM IS PLAYED
      110 PRINT OP$
      120 PRINT RF$;CUR
      130 INPUT NEW$ : IF NEW$(1,1) = "!" THEN 500 : INPUT RTPTR : INPUT WRNGPTR
      140 REM NOW HAVE QUESTION TO ASK. RTPTR POINTS AT RECORD TO GO TO IF
  • I call that sort of thing an "Expert System", but that doesn't show up any hits on CPAN either... Sorry.

    -Dom

  • #!/usr/bin/perl -w
    use strict;

    use Data::Dumper;

    my $info = "dog";

    {
      try($info);
      redo if (yes("play again?"));
    }
    print "Bye!\n";
    print Dumper($info);

    sub try {
      my $this = $_[0];
      if (ref $this) {
        return try($this->{yes($this->{Question}) ? 'Yes' : 'No' });
      }
      if (yes("Is it a $this")) {
        print "I got it!\n";
        return 1;
      };
      print "no!?  What was it then? ";
      chomp(my $new = <STDIN>);

    --
    • Randal L. Schwartz
    • Stonehenge
    • Thanks for that - I suspect it may be a good start towards what I'm looking for. I like the way it builds the tree inside $info. Although I'll probably need multiple choices.
       
      There's a Prolog program here [csupomona.edu] that looks a promising start as well.