General > General Technical Chat

Code Poetry

(1/2) > >>

Omega Glory:
Anybody here every try writing code poetry? Here's an attempt in Python. This will run (assuming "ant.py" exists), but doesn't do anything. The best code poems actually have some kind of neat side effect.

EPAIII:
Some people have

ENTIRELY TOO MUCH

time on their hands.

(It doesn't rhyme, but it has a sort of meter.)

SiliconWizard:
https://en.wikipedia.org/wiki/Shakespeare_Programming_Language

IanB:

Omega Glory:
@EPAIII

Yeah, it doesn't rhyme, but I was trying to limit myself to keywords as much as possible, which makes it hard. The
--- Code: ---open("you","r")
--- End code ---
was fun because the "r" actually does something here (tries to open the file "you" in read mode). And the fact that it comes between the a
--- Code: ---try:
--- End code ---
and
--- Code: ---finally:
--- End code ---
means if the file doesn't exist, the exception will be caught. Though to be fair, the underscore will evaluate to False which may prevent the open from running due to "short circuit" evaluation of the logical and. Ah, and the first if statement will evaluate to False anyway.

 @SiliconWizard
Shakespeare is great, hahaha. Have you seen Chef? https://esolangs.org/wiki/Chef (nice example), https://www.dangermouse.net/esoteric/chef.html (syntax)

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod