#!/usr/bin/perl -wT # /home/sites/www.in-vacua.com/web/cgi-bin/tales1.pl use CGI qw(:standard); ################################################################################## # # # 'tales1.pl' (description: generates versions of the fairytales of Joseph E. Grimes # - date: 1963) # Copyright (C) 2022 Wayne Clements # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # See . # # The program is presented as it is on my website. # The html and links are as per in-vacua.com. You can change this as necessary. # # I'd appreciate a credit if you use any of the code. # # Wayne Clements, www.in-vacua.com. email: invacua_at__btinternet[Do T]com # ################################################################################ use strict; my ($html1); ################ my (@s10, @s20, @s30, @s40, @s50, @s60, @s70, @s80, @s90); my ($s10, $s20, $s30, $s40, $s50, $s60, $s70, $s80, $s90, $s1, $s2, $s3, $s4, $s5, $s6, $s7, $s8, $s9, $line1, $line2, $line3); @s10 = ("LION", "UNICORN", "DRAGON", "WISE OWL"); @s20 = ("IN TROUBLE", "TROUBLED", "CURSED", "BURDENED", "ILL-FATED", "AFFLICTED"); @s30 = ("A LONG TIME", "MANY YEARS", "WHAT SEEMS AN ETERNITY", "WHAT SEEMS FOREVER"); @s40 = ("DOG", "RAVEN", "FOX", "WOLF", "MAGPIE"); @s50 = ("STEALS", "TAKES", "ESCAPES WITH", "PURLOINS", "PILFERS", "ABSCONDS WITH"); @s60 = ("SOMETHING", "A TREASURE", "A RING", "A GOLDEN CHALICE", "A JEWEL"); @s70 = ("KILLS", "VANQUISHES", "DEFEATS", "OVERCOMES", "BEATS", "OVERPOWERS"); @s80 = ("WITHOUT A FIGHT", "WITH A SPELL", "BY A MAGIC SPELL", "WITH GOD'S HELP", "BY GOOD FORTUNE", "WITH LUCK"); @s90 = ("POSSESSION", "TREASURE", "PRECIOUS POSSESSION", "PRIDE AND JOY"); $s1 = $s10[int(rand(@s10))]; $s2 = $s20[int(rand(@s20))]; $s3 = $s30[int(rand(@s30))]; $s4 = $s40[int(rand(@s40))]; $s5 = $s50[int(rand(@s50))]; $s6 = $s60[int(rand(@s60))]; $s7 = $s70[int(rand(@s70))]; $s8 = $s80[int(rand(@s80))]; $s9 = $s90[int(rand(@s90))]; $line1 = join '', ('A ', $s1, ' HAS BEEN ', $s2, ' FOR ', $s3, '. A ', $s4, ' ', $s5, ' ', $s6, ' THAT BELONGS TO THE ', $s1, '. THE HERO, ', $s1, ', ', $s7, ' THE VILLAIN, ', $s4, ', ', $s8, '. THE HERO, ', $s1, ', THUS IS ABLE TO GET HIS ', $s9, ' BACK.'); ############# print "Content-type: text/html\n\n"; print "Grimes' Fairytales
Grimes' Fairytales


"; print $line1; print "



This page reloads with a new text every 15 seconds.

Grimes' Fairytales are based on an early folk-tale generating computer program
by Joseph E. Grimes dated 1963. They have some claim to be the earliest
computer written prose fiction.

It seems the program is lost. Only one output survives:

'A LION HAS BEEN IN TROUBLE FOR A LONG TIME. A DOG STEALS SOMETHING THAT
BELONGS TO THE LION. THE HERO, LION, KILLS THE VILLAIN, DOG, WITHOUT A
FIGHT. THE HERO, LION, THUS IS ABLE TO GET HIS POSSESSION BACK'.



James Ryan reproduces this text in his Conference Paper: 'Grimes' Fairy Tales: A 1960s Story Generator'.

As we have only one output, and we lack the program, I have invented a version
using the published example as a template.

Grimes abandoned the original project: 'The thing I never
put my finger on was that my computer's stories...were all boring.'

The code is here

Wayne Clements. June 2022


HOME

";