Code bowling using unique characters
+1
−0
The aim of the challenge is to write as long a source code as possible (code bowling), every character typed gives 1 point, using the following rules:
-
No symbol typed in the source may be re-used twice. That is, only one
a
, only one1
, only one+
and so on. - Whitespace characters do not count and may be used multiple times (space, line feed, cr, tab etc).
- Other non-printable characters may be present but do not count.
- A standard American keyboard layout/locale is assumed, see wikipedia.
- No symbols may be present inside string literals. Empty string literals are accepted (if you can manage to type one without using
"
twice). - No comments may be present.
- The program must compile for the given language and run without crashing.
- No special behavior or input/output is required.
Looking for feedback:
- Is this challenge at all feasible? Too restrictive in too many languages?
- Should special exceptions be made for very common symbols like
()
and;
? As in allowing them but they do not count towards the total score? - Should function-only solutions be allowed? Or maybe it should only ask for function-only solutions?
EDIT:
I suppose the only allowed characters should be the old school 7 bit ASCII, not counting whitespace characters):
!"#$%&'()*+,-./0123456789:;=>?
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
`abcdefghijklmnopqrstuvwxyz{|}~
Meaning that the highest possible score is 93.
Example solution (purposely naive) in the C language:
main()
{
double cfghjkpqrstvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ = !-1234/5+6*78|90;
}
Score: 74.
Simple test tool, paste source below "Code" in TIO then check output.
(Hopefully bug-free, proof-reading is welcomed!)
3 comment threads