Write two triangle (i.e. pyramid) shaped programs.
The first one should be an upwards pointing text triangle with a minimum base width of three characters. So it would have a structure like
X XXX XXXXX
X XXX XXXXX XXXXXXX
or larger. Each of the
X's is to be replaced with the characters of your actual code, which may be anything except line terminators (so the
X's could be spaces). All the
X's must be replaced and the spaces and newlines that help form the triangle shape are required to stay as is.
The second program must have the same size and shape as the first, except that the triangle will be pointing down.
So if your first program looks like
X XXX XXXXX
then your second program would look like
yyyyy yyy y
y is a character you need to fill in with your actual code (probably different from your
X code). The spaces and newlines must stay the same here too.
Your task is to write these programs such that they each output (to stdout or closest alternative) the title of a distinct Beatles song, not taking any input. This Wikipedia article will serve as our official song list for The Beatles. The output should be one of the titles exactly as listed, e.g.
I Want You (She's So Heavy).
This is pretty easy, however, even with the weird triangle program requirement. So we're going to form another program from the first two that must output yet another song title.
By combining three copies of each of the two triangular programs we can create a third program shaped like a hexagon.
If the base width of your first program was three it would look like this:
XyyyX XXXyXXX yyyXyyy yXXXy
If the base width was five it would look like this:
XyyyyyX XXXyyyXXX XXXXXyXXXXX yyyyyXyyyyy yyyXXXyyy yXXXXXy
This program (when run with the spaces and newlines like the others) must output another Beatles song title, just like the first two programs. Also:
- Your three programs must output different song titles.
- Only song titles eight characters in length or longer are allowed.
- You can only choose one of
Revolution 9because the titles are so similar.
- You must choose your three favorite Beatles songs. (Well, try to.)
Note that actual programs are required. Functions are not allowed. Reading your own source code in any program is also not allowed.
If your first program was
A AAA AAAAA
it could output
Across the Universe.
Then your second program
bbbbb bbb b
Then combined into the hexagon program
AbbbbbA AAAbbbAAA AAAAAbAAAAA bbbbbAbbbbb bbbAAAbbb bAAAAAb
the output might be
The submission with the smallest triangle base width wins. In the likely case of ties the submission with the largest summed length of its three song titles wins.