COBOL
ID DIVISION
DATA DIVISION
01 HELLOWORLDBINARY
05 HE COMP PIC 9999
05 LL COMP PIC 9999
05 OCOMMA COMP PIC 9999
05 SPACEW COMP PIC 9999
05 ORTEXT COMP PIC 9999
05 LD COMP PIC 9999
05 EXCLAMATION COMP PIC 9999
01 FILLER REDEFINES HELLOWORLDBINARY
05 HELLOWORLDTEXT PIC XXXXXXXXXXXXX
05 FILLER PIC X
PROCEDURE DIVISION
MOVE 51333 TO HE
MOVE 37779 TO LL
MOVE 38507 TO OCOMMA
MOVE 16614 TO SPACEW
MOVE 38553 TO ORTEXT
MOVE 37764 TO LD
MOVE 23104 TO EXCLAMATION
DISPLAY HELLOWORLDTEXT
GOBACK
Required some changes to become truly alphanumeric source only.
PROGRAM-ID can be dropped. You get a generated program name (see messages).
WORKING-STORAGE can be dropped. Again the compiler moans.
Since both of these lines previously had missing full-stops/periods, which are no longer relevant now that the descriptions are entirely missing, the number of error messages is the same as before, and still does not affect the generated code for the program.
In changing COMP-5 to COMP, the VALUE clauses are no longer allowed, as COMP 9999 is only four decimal digits whereas COMP-5 is a two-byte binary with all bit-values available.
The values in the MOVEs are the decimal values which give the binary values which give the pairs of characters.
Even though the COMP fields have four digits, and do not allow VALUE clauses with more than four digits, you can use more digits in the MOVE of a literal value without truncation at that point... don't ask me why. Compiler option DIAGTRUNC (which I have turned off) will produce Warning diagnostics for these.
Compiler option TRUNC(BIN) could be used to treat COMP as COMP-5, but the MOVEs are another way to do it.
Since it is COBOL, the output must be in UPPER CASE (a lie, but just for fun).
HELLO WORLD!
OK, relented, now produces:
Hello, World!
Which, being an odd-number of characters, required some further changes, since we can't have odd-number-byte binary fields with this compiler. Look at that line of 13 Xs! It would normally be written as X(13), but can be as I've shown...
And ORTEXT is needed (or not OR, anyway) as a name because OR is a reserved word to the compiler (it means OR, of course).
These are EBCDIC values, not ASCII, since it is running on an EBCDIC-aware, and Big Endian, box.
Oh, COBOL requires lots of full-stops/periods. I left them out (they're banned) so got lots of compile messages. Just told the compiler to generate the code anyway (none of the messages relate to the object code).
Even without DIAGTRUNC, the messages are now up to 17...
1 IGYDS1003-E A "PROGRAM-ID" paragraph was not found.
Program-name "CBLNAM01" was assumed.
2 IGYDS1082-E A period was required. A period was assumed
before "DATA".
3 IGYDS1082-E A period was required. A period was assumed
before "01".
Same message on line: 11
3 IGYDS1040-E A data item was found in the "DATA DIVISION"
before a section header was encountered.
"WORKING-STORAGE SECTION" was assumed.
4 IGYDS1082-E A period was required. A period was assumed
before "05".
Same message on line: 5 6 7 8
9 10 12 13
14 IGYDS1082-E A period was required. A period was assumed
before "PROCEDURE".
15 IGYPS2145-E A period was required. A period was assumed
before "MOVE".
23 IGYSC1082-E A period was required. A period was assumed
before "END OF PROGRAM".
tcl: Possible if
%
is allowed:puts Hello[format %c 44][format %c 32]World[format %c 33]
– sergiol – 2017-01-04T22:04:02.180Would the downvoter care to explain his/her vote? I'dlike to know how I could make this better. – wec – 2014-03-05T13:59:32.257
Didn't DV, but what do you mean when you say "all characters must be..." Most languages use other characters for even the most basic tasks: (){}[]/-+., etc. Are those banned? – Geobits – 2014-03-05T14:00:53.980
Yes, they are. Should I widen the allowed characters a bit to include (), [], and {}? – wec – 2014-03-05T14:03:15.640
1Up to you, I'm just making sure. What about whitespace? – Geobits – 2014-03-05T14:04:10.573
Ok, I think I'll widen the character number restriction, because as it is this is basically a duplicate of [Hello world! With limited character repetition] (http://codegolf.stackexchange.com/questions/18721/hello-world-with-limited-character-repetition?rq=1). Does 5 sound like a petter number?
– wec – 2014-03-05T14:09:54.9171Oh, right white space. My brain is clearly not functioning properly today. That should be allowed. One second, let me fix the rules. – wec – 2014-03-05T14:15:54.160
What about these: ;?:&<>/+-,. ? – Ismael Miguel – 2014-03-05T14:17:37.777
8So, no operators? And, most importantly, no
;
? How can I write anything in C? – Oberon – 2014-03-05T14:22:05.0771esolangs.org Hello, World! – Geobits – 2014-03-05T22:41:46.037
3+1 for figuring out how to exclude J in a natural way:
72 101 108 108 111 44 32 87 111 114 108 100 33{a.
requires the period at the end to work, and a path throughu:
similarly requires a colon. Without.
and:
we are nothing. – algorithmshark – 2014-03-05T23:32:48.6731"I will allow as it is the de facto standard for Python." Allow what? – Blorgbeard is out – 2014-03-06T06:10:26.967
Oops, I was talking about TkInter for Python GUIs. – wec – 2014-03-06T13:56:05.367
Damnit. I was thinking of Vim, but you still need to type the !, and the <> need to go around ESC. :/ – AlbeyAmakiir – 2014-03-10T00:10:52.463
No dots or commas? :( – nyuszika7h – 2014-03-10T16:39:05.547
1Java? Impossible. I've been thinking about this for about half an hour and I say there's no way to do it. – DankMemes – 2014-05-13T23:46:17.407