Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8
Rust port of the Terry Davis' (RIP) "god says" program
License
orhun/godsays
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
RIPTerry A. Davis 1969-2018
Rust port of the programmer Terry Davis'"god says" (AKAGodSpeaks) program.
Terrence Andrew Davis (December 15, 1969 – August 11, 2018) was an American programmer who created and designed the operating systemTempleOS alone. It was a highly complex and unusual undertaking for one person, as the project extended to building core components such as programming language, editor, compiler and kernel virtually from scratch. Davis also posted video blogs to social media, and by the time of his death, had amassed a small online following. He often referred to himself as "the smartest programmer that's ever lived".FromWikipedia.
About TempleOS, from his own words:
TempleOS is God's official temple. Just like Solomon's temple, this is acommunity focal point where offerings are made and God's oracle is consulted.
Contained in Terry's TempleOS masterpiece were various random text generators. Terry believed that by generating this text one could "speak to God". Through making random associations in the text, much like aRorschach ink-blot test.
For that purpose, he designed a random number generator calledgod, and used it in TempleOS to generate text.
The original source of this program can be foundhere.
Besides the original program which was written inHolyC, he was using a bash script to generate text:
#!/bin/bash# This prints random words.echo"$(gshuf -n 32 ./Happy.TXT --random-source=/dev/urandom| tr'\n''')"
So I reproduced this logic in Rust and created a simple CLI program (godsays) and a webserver (godsays-server) for extended use-cases (and tribute to TAD).
Please note that some of the words may be offensive - I am merely using Terry's original wordlist and thus cannot be held responsible for any of the views expounded by God in the generated text. The only modification that has been made to Terry's text is the replacement of underscores with spaces.
Install the CLI tool fromcrates.io:
cargo install godsays
godsays command line tool simply selects 32 random words fromHappy.TXT and prints them out.
cargo run
output:
sloth special case I'll ask nicely incredibly in a galaxy far far away what do you want I'm done slumin oh no the enquirer really by the way that's for me to know Isn't that special don't mention it baffling furious I'll think about it Han shot first downer unsung hero super computer horrendous ahh who's to say You da man I give up cosmetics it'd take a miracle stuff holy grail I'll be back* Use of the--release flag embeds theHappy.TXT into the binary.
Pull the latest image from Docker Hub and run the container:
docker pull orhunp/godsaysdocker run -t orhunp/godsays
Or do it manually:
docker build -f docker/cli/Dockerfile -t godsays.docker run -t godsaysgodsays-server is a simple HTTP server with the same purpose ofgodsays. It returns the randomly generated text on aGET / request. (UseGET /json for JSON output)
curl https://godsays.xyz
output:
ba ha you know a better God do not disturb its trivial obviously ho ho ho failure to communicate if anything can go wrong do you like it in a perfect world that's all folks eh Mission Accomplished super computer Trump kick back vice liberal gosh baffling I'm in suspense holier than thou frown in a galaxy far far away in practice China tree hugger scum snap out of it I'm on a roll joyful money what's it to youto run locally:
cargo run --features server --bin godsays-server
* A fun use case is creating a git alias as follows:
git config --global alias.godsays'!git commit -m "$(curl -s https://godsays.xyz)"'Pull the latest image from Docker Hub and run the container:
docker pull orhunp/godsays-serverdocker run --rm -e"ADDR=0.0.0.0:3000" -dp 3000:3000 orhunp/godsays-serverOr do it manually:
docker build -f docker/server/Dockerfile -t godsays-server.docker run --rm -e"ADDR=0.0.0.0:3000" -dp 3000:3000 godsays-server
- https://templeos.org/
- TempleOS Archive
- https://www.youtube.com/watch?v=xDHQ1yBbS-Q (Tribute Terry Davis)
- https://www.youtube.com/watch?v=mBgIBF9Y6PE (TempleOS: Terry Responds to the Haters)
- https://jcpsimmons.github.io/Godspeak-Generator/ (JavaScript port)
- https://github.com/rethyxyz/godspeaks (Python port)
- https://christine.website/blog/templeos-2-god-the-rng-2019-05-30 (
god, the Random Number Generator)
Copyright © 2021-2024,Orhun Parmaksız
About
Rust port of the Terry Davis' (RIP) "god says" program
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
