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

Pages: 1-

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-15 19:25

CIA nigger detected

Name: Anonymous 2018-06-15 19:35

>>2
Dr. Pavel, I glow in the dark.

Name: Anonymous 2018-06-16 4:42

>>1
don't run this
I'm posting from a library computer because my pc was hacked after I pasted this in a terminal

FUCK you OP

impolite sage

Name: Anonymous 2018-06-16 4:55

>>4
troll

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";

Name: Anonymous 2018-06-16 18:49

>>6
Why are you parsing and storing the entire dictionary you mental midget?

Name: Anonymous 2018-06-16 18:55

>>6
If you're using already using perl just use perl
clearly he wanted to save 2 lines of code

Name: Anonymous 2018-06-16 19:00

God says involutedly
Cajan
eburneous
demivolt
antirailwayist
classifier
evitable
cremnophobia
Ganowanian
foredispose

Name: Anonymous 2018-06-16 20:53

>>7
Do you know how computers work?

>>8
Acceptable.

Name: Anonymous 2018-06-16 21:03

>>10
Do you know how Perl works?

OP ought to use
wc -l
on the words file instead of that 99999 tho.

Name: Anonymous 2018-06-17 2:38

>>11
God knows how perl works.
God says galloping
contagium
fidate
auroauric
berserker
hydropsy
hyperpure
accusatival
greedsome
bonding

Name: Anonymous 2018-06-17 2:41

also if you change 99999 to 235886 it works better because that's the size of my dictionary file (though yours might be different)

Notice how the previous program outputs I posted only have words starting with letters that are early on in the alphanet.

Here's the difference in output with 235886 instead:
God says caudotibialis
jailbird
premove
workable
dissatisfied
octachloride
cinematographically
acrimony
polycotyledony
wombed

Name: Anonymous 2018-06-17 4:51

he’s one of those old school programmers that knows everything about bit level memory fiddling and kernals but probably doesn’t know how to implement a markov chain.

Name: Anonymous 2018-06-17 5:50

>>14
the kind of boomer who sends email attachments like project_version4_June_17_2018.zip instead of using a git repo

Name: Anonymous 2018-06-17 6:17

>>11
perl seems really improfessional, like some old drunk dudes designed it at a pub

https://perlmaven.com/slurp
https://perldoc.perl.org/functions/chomp.html
https://perldoc.perl.org/functions/die.html
https://perldoc.perl.org/functions/dump.html
https://perldoc.perl.org/functions/glob.html

and it's so fucking terse! a 5 byte perl script is like 200 lines of java
if you're obsessed with code golf, I guess it's good by that metric
but for readability, it's awful

Name: Anonymous 2018-06-17 7:02

There is module to translate perl to C
https://metacpan.org/pod/B::CC

Name: Anonymous 2018-06-17 13:51

>>10
How does @array = <$fh> work? Is it just storing file positions?

Name: Anonymous 2018-06-17 14:43

>>18
Array of strings of file lines.

Name: Anonymous 2018-06-17 15:41

>>19
So then it does have to parse and store the entire file immediately.

Name: Anonymous 2018-06-20 21:08

>>16
did you know they reunited germany?
welcome to 20 years ago

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