### Nickolas's blog

By Nickolas, 8 years ago, translation, ,

The round is over, I hope you have enjoyed it. Here is the editorial.

The language of this round is COBOL (dialect COBOL85), one of the oldest programming languages (date of “birth”: 1959, so it’s twice older than I am). Despite being so old, it’s still in active use, though not in programming competitions, so I think it should be enough of a surprise for you :-)

The problem "A+B" (numbers A and B given in separate lines) can be solved in a following way:

       IDENTIFICATION DIVISION.
PROGRAM-ID. SOLUTION.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 A        PIC 9(10)   VALUE ZEROES.
01 B        PIC 9(10)   VALUE ZEROES.
01 STR      PIC X(10).

PROCEDURE DIVISION.
ACCEPT STR
MOVE STR TO A
ACCEPT STR
MOVE STR TO B
DISPLAY B
STOP RUN.


You can find examples of COBOL programs in a Progopedia article and in RosettaCode article as well as in OpenCOBOL manuals.

The testing system uses OpenCOBOL 1.0. To test your programs before submitting, you can:

• use “Custom test” tab in the contest interface.
• use ideone, language COBOL. Remember that by default doces submitted by anonymous are shown in “recent codes”; to avoid this I recommend registering and using “user’s” privacy option or at least use “private” option..
• install the compiler locally.

If you use Linux, this compiler is present in the repositories. After installing the compiler use cobc -std=cobol85 -x <filename> to compile the code and create the executable.

If you use Windows and have Visual Studio C++ inslalled (tested with 2005 Express Edition):

• extract the contents using password fe8b058ca460d2 to folder C: — unfortunately, the executables of the compiler require it to be located in folder C:\OpenCobol
• keep your source code in C:\OpenCobol as well, and compile them using compile.bat solution.cob

Surprise Language Round #5 will be held on February 22nd. It will continue the series of Unknown Language Rounds; we decided to replace the term “Unknown”, since we can’t really guarantee that the language of the round will be unknown to all participants, and the more rounds are there, the more probable it is that somebody has already seen one of the languages.

The rules will differ from the typical Codeforces Rounds:

• This round will be unrated and it will use ACM ICPC rules.
• It will have 5 problems, sorted by estimated complexity.
• Solutions are accepted only in one language, which will be announced at the beginning of the contest. Please reread this post at the beginning of the contest.

The contest is intended to be relatively small and not as brain-taxing as my previous one — it’s a weekday, after all. Good luck!

Announcement of Surprise Language Round #5

• +166

 » 8 years ago, # |   +4 Hi I have a question. how I can learn the syntax and rules of that language in middle of the contest? is there any help in the contest?thanks a lot. :)
•  » » 8 years ago, # ^ |   +22 The point of such contests is that you have to find the things you need to write the solutions yourself. You will be given the compiler/interpreter you have to use, and a very basic example of code, maybe a link to some more examples, but that's all, you'll have to find and explore any documentation you'll need on your own. The problems are simple so you need to care only about learning the language, not about figuring out the algorithm.
 » 8 years ago, # | ← Rev. 2 →   0 But... This is an existing language, or one created by yourself?
•  » » 8 years ago, # ^ | ← Rev. 2 →   0 I think, that should be existing one. Otherwise how would you find any documentation. :)
•  » » 8 years ago, # ^ |   0 Existing
•  » » 8 years ago, # ^ |   +9 Last time it was Befunge.
 » 8 years ago, # |   +8 Hi everybodyI didn’t know that I’m not allowed to post in a non-English language …My Blog PostI have only translated an English post to my native language and my Contribution is -55 now.What I have to do ?thanks.
•  » » 8 years ago, # ^ |   -59 There is so much trolls in this site...
•  » » » 8 years ago, # ^ |   0 I think that it is cool site. I like their contests.
 » 8 years ago, # |   +12 Befunge was realy cool :)
 » 8 years ago, # |   0 What means "The round will be unrated" ? It won't affect our rating or what?
•  » » 8 years ago, # ^ |   +3 Yes, it won't affect our rating, I think. Good Luck! :)
•  » » 8 years ago, # ^ |   +3 Yes, it won't. It simply for fun.
 » 8 years ago, # |   0 Ty guys :) GL all
 » 8 years ago, # |   +1 what about linux users?will compiler be provided later during the contest?
•  » » 8 years ago, # ^ |   +8 Use online compiler or install it from repositories.
•  » » 8 years ago, # ^ |   0 i got the answer,,,:)
 » 8 years ago, # |   +2 What to do if I have windows that does not have visual studio c++, only have codeblocks IDE?
•  » » 8 years ago, # ^ |   +9 Use online compiler access.
 » 8 years ago, # | ← Rev. 4 →   -8 COBOLARE YOU KIDDING ME
 » 8 years ago, # |   +43 The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offense. (E. Dijkstra)
 » 8 years ago, # |   +26 I feel sorry for the people that use COBOL for living :P
 » 8 years ago, # |   +7 WHY C'S 14 FAILS ALL TIME?RPU + 14 -> FDITHE SECOND LINE IN THE INPUT IS OBVIOUS 0 NOT 14
•  » » 8 years ago, # ^ |   0 "Note that numeric variables are read into strings and then converted into numbers — this is explained by the compiler specifics which reads numbers in different ways depending on whether they are read from cosole or from file redirected to the program input stream."
•  » » » 8 years ago, # ^ |   0 thanks a lot I tested from 0 to 25 in my console with no problem
 » 8 years ago, # |   +2 Here is my code for problem A. gl & hf. :P
 » 8 years ago, # |   +4 Thanks for such a nice contest :)I experienced a few annoying problems which I don't understand until now: Sometimes the compiler just doesn't work. I used windows. I had to restart cmd once every five minutes. Lots of "Error: syntax error, unexpected LITERAL, expecting EXTERNAL or GLOBAL". I tried to google but it didn't help. Anyone experienced the same problems and understand how it happened? :)
•  » » 8 years ago, # ^ |   +8 I received that error (Error: syntax error, unexpected LITERAL, expecting EXTERNAL or GLOBAL) because i made a typo in a declarationI put 01 str X(15).But forgot to put the "pic": 01 str pic X(15).I also looked for it on google, but didn't find much, some said that this error was caused by additional spaces, so i looked into that, and i noticed the missing pic keyword, which solved the issue.
•  » » » 8 years ago, # ^ |   0 Thanks. Seems like that was exactly what happened. During contest I was too frustrated and rewrote most of the codes :)) Cost me quite a lot of time :(
•  » » 8 years ago, # ^ |   +9 It tries to append something to your PATH each time you call it :) So eventually the PATH will become too long that Windows cannot process it.
 » 8 years ago, # |   0 Thanks for the contest! At times it was a bit frustrating when I got lost in figuring out smaller details like removing the trailing zeros or concatenating strings without spaces in between. But I suppose that was to some extend intended :) Right now I have to admit that I would rather code in Befunge than in COBOL. There you have that really small set of possible operations which gives you the power to create complex structures (loops, etc.) yourself (which was fun) while COBOL provides all this — but you have to figure out what the right syntax is. This almost always took me longer than implementing it myself in Befunge last time.
 » 8 years ago, # |   +3 COBOL just like COLLECTION, neither of them is easy to learn. ：<
 » 7 years ago, # | ← Rev. 2 →   -11 If any of you are interested in participating in an external surprise language contest, there is a contest starting tomorrow(3rd march) at 12:30 Gmt. Contest Link: http://chaos.techkriti.org