From d91b2b942b14d2bbcc3410571a35a4453abb34d8 Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Thu, 24 Aug 2023 05:46:55 +0200 Subject: [PATCH] Add a Python implementation of the lyrics Not really relevant, but I had it written, so why not :-) --- other/lyrics.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 other/lyrics.py diff --git a/other/lyrics.py b/other/lyrics.py new file mode 100644 index 0000000..1a631d9 --- /dev/null +++ b/other/lyrics.py @@ -0,0 +1,23 @@ +#!/bin/python3 +"""A simple script to just print lyrics. + +Mainly for inspiration for the Scheme code.""" + +items = ['bog', 'hole', 'seed', 'tree', 'branch', ...] + +last = 'a bog down in the valley, oh.' + +intro = 'And in that {x} there was a {y}, a rare {y} a rattling {y}' # FIXME: in vs on + +chorus = 'Oh row a rattling bog a bog down in the valley oh.\n'*2 + +### init + +print(chorus) + +for l in range(1,len(items)): + print(intro.format(x=items[l-1], y=items[l])) + for i in range(l, 0, -1): + print('{x} in the {y}'.format(x=items[i], y=items[i-1])) + print(last) + print(chorus)