Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Terry Davis's god in just 7 lines of bash

Name: Anonymous 2018-06-15 18:34

I don't know how many lines of HolyC are required for his program for ``talking to god'' but I can remake it really easily.
#!/bin/bash
echo -n "God says "
numWords=10 #or however long you want it to be
until [ $numWords -lt 1 ]; do
sed `perl -e "print int(rand(99999))"`"q;d" /usr/share/dict/words
let numWords-=1
done

The output doesn't make sense grammatically, but then again, neither does Terry's shit.

Name: Anonymous 2018-06-16 18:24

If you're using already using perl just use perl.

#!/usr/bin/env perl
use strict;
use warnings;

my $nwords = $ARGV[0] // int(1 + rand(40));

open my $f, "<", "/usr/share/dict/words" or die;
chomp(my @words = <$f>);
close $f;

my @sentence = map { $words[rand(@words)] } 0..($nwords - 1);

print "God says: " . join(" ", @sentence) . "\n";

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List