RosettaCodeData/Task/Long-literals-with-continuations/00-TASK.txt
2023-07-01 13:44:08 -04:00

69 lines
3.5 KiB
Text

This task is about writing a computer program that has long literals   (character
literals that may require specifying the words/tokens on more than one (source)
line,   either with continuations or some other method, such as abutments or
concatenations   (or some other mechanisms).
The literal is to be in the form of a "list",   a literal that contains many
words (tokens) separated by a blank (space),   in this case   (so as to have a
common list),   the (English) names of the chemical elements of the periodic table.
The list is to be in (ascending) order of the (chemical) element's atomic number:
''hydrogen helium lithium beryllium boron carbon nitrogen oxygen fluorine neon sodium aluminum silicon ...''
... up to the last known (named) chemical element   (at this time).
Do not include any of the   "unnamed"   chemical element names such as:
''ununennium unquadnilium triunhexium penthextrium penthexpentium septhexunium octenntrium ennennbium''
To make computer programming languages comparable,   the statement widths should be
restricted <u>to less than</u> &nbsp; '''81''' &nbsp; bytes (characters), &nbsp; or less
if a computer programming language has more restrictive limitations or standards.
Also mention what column the programming statements can start in if &nbsp; ''not'' &nbsp;
in column one.
The list &nbsp; ''may'' &nbsp; have leading/embedded/trailing blanks during the
declaration &nbsp; (the actual program statements), &nbsp; this is allow the list to be
more readable. &nbsp; The "final" list shouldn't have any leading/trailing or superfluous
blanks &nbsp; (when stored in the program's "memory").
This list should be written with the idea in mind that the
program &nbsp; ''will'' &nbsp; be updated, &nbsp; most likely someone other than the
original author, &nbsp; as there will be newer (discovered) elements of the periodic
table being added &nbsp; (possibly in the near future). &nbsp; These future updates
should be one of the primary concerns in writing these programs and it should be "easy"
for someone else to add chemical elements to the list &nbsp; (within the computer
program).
Attention should be paid so as to not exceed the &nbsp; ''clause length'' &nbsp; of
continued or specified statements, &nbsp; if there is such a restriction. &nbsp; If the
limit is greater than (say) 4,000 bytes or so, &nbsp; it needn't be mentioned here.
;Task:
:* &nbsp; Write a computer program (by whatever name) to contain a list of the known elements.
:* &nbsp; The program should eventually contain a long literal of words &nbsp; (the elements).
:* &nbsp; The literal should show how one could create a long list of blank-delineated words.
:* &nbsp; The "final" (stored) list should only have a single blank between elements.
:* &nbsp; Try to use the most idiomatic approach(es) in creating the final list.
:* &nbsp; Use continuation if possible, and/or show alternatives &nbsp; (possibly using concatenation).
:* &nbsp; Use a program comment to explain what the continuation character is if it isn't obvious.
:* &nbsp; The program should contain a variable that has the date of the last update/revision.
:* &nbsp; The program, when run, should display with verbiage:
:::* &nbsp; The last update/revision date &nbsp; (and should be unambiguous).
:::* &nbsp; The number of chemical elements in the list.
:::* &nbsp; The name of the highest (last) element name.
Show all output here, on this page.
{{Template:Strings}}
<br><br>