Return Entire thread

Durga Software Solutions

3 Name: Mentifex : 2016-04-11 12:12
http://ai.neocities.org/P6AI_FAQ.html

Yesterday we wrote the following ki0016.pl program in
Perl that would create the program nuntius.pl in Perl.

#!/usr/bin/perl
use strict; # 2016apr10: PERL by Example (2015) p. 77
use warnings; # 2016apr10: PERL by Example (2015) p. 85
our $counter = 0; # 2016apr10: use counter separate from IQ
our $IQ = 0; # 2016apr10: PERL by Example (2015), p. 17
our $msg = " "; # 2016apr10:
our $text01 = " "; # 2016apr10: for writing to a separate file.
our $text02 = " "; # 2016apr10: for writing to a separate file.
our $text03 = " "; # 2016apr10: for writing to a separate file.
our $text04 = " "; # 2016apr10: for writing to a separate file.
our $text05 = " "; # 2016apr10: for writing to a separate file.
our $text06 = " "; # 2016apr10: for writing to a separate file.
our $text07 = " "; # 2016apr10: for writing to a separate file.
our $text08 = " "; # 2016apr10: for writing to a separate file.
sub Sensorium; # PERL by Example p. 351 Forward declaration

use IO::File; # 2016apr10: Perl_Black_Book p. 561
my $fh = new IO::File; # 2016apr10: Perl_Black_Book p. 561
$fh->open(">nuntius.pl") or die "Can't open: $!\n"; #2016apr10
$, = "\n"; # 2016apr10: PBB p. 560

$text01 = "#!/usr/bin/perl"; # 2016apr10: usual start of a Perl program.
$fh->printf ("$text01 \n"); # 2016apr10: PBB p. 535

$text02 = "use strict;"; # 2016apr10: typical early part of a program
$fh->printf ("$text02 \n"); # 2016apr10: PBB p. 535

$text03 = "use warnings; "; # 2016apr10: typical early part of a program
$fh->printf ("$text03 \n"); # 2016apr10: PBB p. 535

$text04 = "print 'Type your input: '; "; # 2016apr10:
$fh->printf ("$text04 \n"); # 2016apr10: PBB p. 535

$text07 = 'my $msg = <STDIN>; '; # 2016apr10:
# $fh->write($text07, length($text07)); # 2016apr10: PBB p. 535
$fh->printf ("$text07 \n"); # 2016apr10: PBB p. 535

$text08 = "print \"Human: \$msg\";"; # 2016apr10: PbEx p. 57 can\'t
$fh->printf ("$text08"); # 2016apr10: PBB p. 535

$fh->close; # 2016apr10: Perl_Black_Book p. 561

sub Sensorium() { #
$counter++ ; # 2016apr10: increment counter instead of inputting IQ.
print "Sensorium: IQ = $IQ Enter new IQ: ";
# print "Sensorium: IQ = $IQ \n"; # 2016apr10: not demanding input.
$IQ = <STDIN>; # PERL by Example (2015), p. 50
$IQ++ ; # 2016apr10: increment IQ instead of inputting IQ.
} # 2016apr10:

while ($counter < 8) { # PERL by Example (2015), p. 190
Sensorium(); # PERL by Example p. 350: () empty parameter list
} # End of main loop calling AI subroutines


The program above created a nuntius.pl file of the
following program for accepting human user input.

#!/usr/bin/perl
use strict;
use warnings;
print 'Type your input: ';
my $msg = <STDIN>;
print "Human: $msg";


The goal is to have one large Strong AI program

http://wiki.opencog.org/wikihome/index.php/Ghost

that first creates the nuntius.pl companion program
and then thinks continuously at lightning speed on
a webserver except when receiving human user input.

Return Entire thread

Name: