### Nickolas's blog

By Nickolas, 7 years ago, translation, ,

This time the language is Ada, chosen not for being particularly crazy (it's too Pascal-like to my taste) but for its name. Indeed, a language named for Ada Lovelace seems to be a perfect fit for programmers' professional holiday. I tried to balance the lack of language weirdness by problems somewhat less trivial than usual.

Here is the traditional solution for "A+B" problem (integers A and B can be given in one line):

with Ada.Integer_Text_IO;

procedure AplusB is
A, B: Integer;

begin
Get(Item => A);
Get(Item => B);
Put(Item => A + B, Width => 1);
end AplusB;


The testing system uses gnat 4.7.2. To test your programs before submitting, you can:

• use “Custom test” tab in the contest interface.
• use ideone, language Ada (gnat-4.6). Remember that by default programs submitted by anonymous are shown in “recent codes”; to avoid this I recommend registering and using "private" privacy option or at least use "secret" option.
• install the compiler locally.

If you use Linux, this compiler is present in the repositories (version 4.4.3 for my Kubuntu). After installing the compiler use gnat make file.adb to compile the code and create the executable. If you have mingw installed, you can run mingw-get install ada and then compile gnatmake file.adb.

September 13th will be Friday the 13th, Programmers' Day — this year not only a professional holiday but also a Surprise Language Round!

The rules of the contest are as follows:

• The contest is unrated for everybody.
• The round uses ACM ICPC rules: the standing is defined by the number of solved problems, ties are resolved based on penalty time. Initially the penalty is 0, and for each solved problem it is increased by submission time (since the start of the contest) + 20 minutes for each failed submission. The solution is considered to be correct if it passes all tests from a predefined test set; you know whether the solution is right immediately after sending it. There are no hacks
• The round has 7 problems, sorted by estimated complexity, and you have 2 hours to solve it.
• Solutions are accepted only in one language, which will be announced at the beginning of the contest. The language was created a while ago, we didn't invent it for this occasion.
• Please reread this post at the beginning of the contest: we will announce the language and add instructions to install the compiler (the contest interface will provide an option to run your solutions online as well) and links to useful manuals. Other than that, learning the language is up to the competitor. You can use any resources to solve the problems (as long as you remember that this is an individual competition); you don't have to limit yourself to the manuals provided in the post.

We hope that the language we chose will be unknown to most of the competitors. For reference, here is the list of Surprise/Unknown Language Rounds which took place on Codeforces earlier.

Round Language
Surprise Language Round #6 Roco
VK Cup 2012 Wild-card Round 1 Factor
Surprise Language Round #5 COBOL
Unknown Language Round #4 Befunge
Unknown Language Round #3 Pike
Unknown Language Round #2 Io
Unknown Language Round #1 Tcl

Good luck! And happy Programmers' Day!

• +230

 » 7 years ago, # | ← Rev. 2 →   -9 How about including this to your blog ? :)Edit : so what's wrong?
 » 7 years ago, # |   -26 What does it mean it is unrated?
•  » » 7 years ago, # ^ | ← Rev. 3 →   +1 It means that your rating (a number resulting from your participations at different contests that you can see on your profile page and who determine the color of your handle) will not be affected by this contest. And if your true question was "why is it unrated?", I think it's just to not give advantage at the rare coders who are lucky and already know the language (Edit: and because it's a lot different from the others contests).
•  » » 7 years ago, # ^ | ← Rev. 2 →   -28 Congratulation Alimzoo!! Your contribution is getting worse, as you want to! ;) Because of this comment, I guess mine is too, but it was worth to say!
 » 7 years ago, # |   0 We missed april fool contest... First i thought it'll be like that
 » 7 years ago, # |   0 hi , im happy for this event . but there's a question in my mind !!? how can we learn the surprise language ? because learning a new language will take time ...
•  » » 7 years ago, # ^ |   +51 Of course you need time, that's why you're given 2 hours.The whole point of this type of contest is not just that you have to solve some (fairly simple) problems but that you have to learn as much of a new language as you can while doing this. How you do this is up to you :)
•  » » » 7 years ago, # ^ |   +1 Thanks for answering This contest is a really good idea Because all are the same at the beginning of the contest and that is very interesting . Thanks by ,
•  » » » » 7 years ago, # ^ |   -20 not exactly, there are possibilities that someone has mastered such surprise language before the contest announcement.
•  » » 7 years ago, # ^ |   0 In Iran learn a new language in two hours wasn't the problem, the real problem was how to download a new compiler in two hours...
 » 7 years ago, # |   +8 We see cobol in surprise language round #5, It's a programming language in BigFrame... The round looks interesting...
 » 7 years ago, # |   +13 Thx for unusual event
 » 7 years ago, # |   +8 Hi and thanks for the contest, Will it be a speed contest or the problems will have some academic loads? Most of the last unknown language contests were speed contest, many participants solved all the problems just in less than an hour! anyway, thanks to Nickolas for this unusual event!
 » 7 years ago, # |   +9 It's the (1<<8)th day of the year! Happy programmers Day to all.
•  » » 7 years ago, # ^ |   -27 (1<<8) ???
•  » » » 7 years ago, # ^ | ← Rev. 3 →   +9 x< 1< 1<<8 = 256;Today is thirteenth of September, it is the 256th day of the year (Programmers' Day). Didn't you know this?
•  » » » » 7 years ago, # ^ |   +5
 » 7 years ago, # |   +2 Unknown Language? Sounds COOL!
 » 7 years ago, # |   0 How early will the language be announced?
 » 7 years ago, # | ← Rev. 2 →   +1 Let's play guess which langue is gonna be.My guess (although it's a weak one) : Brainf*ck
•  » » 7 years ago, # ^ | ← Rev. 2 →   +3 Maybe LOLCODE :)I'm sure it will be one of those at Nickolas' website Progopedia. So let's choose one lng,learn it and know who was lucky. What do you think? :)
•  » » » 7 years ago, # ^ |   0
•  » » » » 7 years ago, # ^ |   0 Yes, I know :)
•  » » 7 years ago, # ^ | ← Rev. 2 →   +2 "We hope that the language we chose will be unknown to most of the competitors."Doubt it's going to be Brainf**k :) Also, God forbids Malbolge from appearing, ever. My guess would be FRACTRAN.
•  » » » 7 years ago, # ^ | ← Rev. 2 →   +4 I know, you're not the only one who can read, it's why i said it's a weak guess, god forbid you people not downvote someone's opinion which differs from yours.
•  » » » » 7 years ago, # ^ |   0 Tip: I didn't downvote your comment.
 » 7 years ago, # |   +2 Is there a compiler for Linux? Give instructions how to install it.
 » 7 years ago, # |   0 when will the announce is attach?
 » 7 years ago, # |   +1 When the language will be announced ???Waiting... :(
•  » » 7 years ago, # ^ |   0 "Please reread this post at the beginning of the contest"
 » 7 years ago, # |   -9 It's Friday the 13th. What could possibly go wrong? ... ;)
 » 7 years ago, # |   0 "The round has 6 problems"I just knew that there are 6 elements in {A, B, C, D, E, F, G}.
•  » » 7 years ago, # ^ |   +35 I felt that announcing 6 problems and giving 7 feels like a nice surprise and much better than the other way around :-)
 » 7 years ago, # | ← Rev. 2 →   +3 "...and links to useful manuals". Can't see them!!!
 » 7 years ago, # |   +5 The language is so hard! Especially when you have not material!
 » 7 years ago, # |   +15 http://www.infres.enst.fr/~pautet/Ada95/a95list.htmThis is a much more interesting resource than wiki, wiki just assumes you already know how to put everything together to make some sense.
 » 7 years ago, # |   +3 "I tried to balance the lack of language weirdness by problems somewhat less trivial than usual."Probably it was necessary, but I wanted something simpler for problem A (like "given an integer n, output n*(n+1)/2").
 » 7 years ago, # |   +78 Ada is a bit unusual, but too Pascal-like for ULR, as I think. Almost everything is supported (calendar, maps and sorting, dynamic arrays), no fastidious code is required for easy things (the only problem I had is with Get/Get_Line and newline characters). I liked COBOL more.However, noone execept me got more than four problems :) and it looks like the round was very and very fun for the rest of community. I swear it was the first time I saw Ada.Thank you, Nickolas!
•  » » 7 years ago, # ^ |   +14 I'm very impressed with your performance — and thank you for making each problem solveable during the contest :-)
 » 7 years ago, # |   +21 Thank you for yet another wonderful surprise language contest!
 » 7 years ago, # |   +14 Quite a fun round :-) Makes you appreciate the languages you actually work in :-) Please have another secret round match soon! :-)
•  » » 7 years ago, # ^ |   +9 Number of programming languages is limited, it's better not to conduct such competitions too often :)
 » 7 years ago, # | ← Rev. 2 →   0 Thank You For Your Wonderful Contest...I think there is an error in judge system for me...LinkWhen I use custom test in Test #5 i get output the 0.23478 and right answer ...Please take a look at this ...
•  » » 7 years ago, # ^ |   0 Your code produces 0.23191 where the correct output is 0.23478. Change the line for I in Str'range loop to this: for I in Integer range 1 .. Last loop and your code will be accepted.
•  » » 7 years ago, # ^ |   +13 I think in this case 'range will return 100 (allocated size) instead of the actual string length. So the rest of the string will be filled with garbage (no end-of-line in fixed-length strings), and the result of the prorgam depends on whether there will be 0, 1 or ? in this garbage. The output varies between runs depending on the contents of the memory — you just were unlucky to get the contents with one of these symbols.
•  » » » 7 years ago, # ^ |   +12 Thanks for reply Dear Nickolas.Yes it caused by me. I should find the string length or initialize first :) to avoid occurrence of this. My resubmission may cause another w/a somewhere else.But I believed ADA miracle today. Several outputs for single code and input ;)
•  » » » » 7 years ago, # ^ |   +1 You don't even need to look for it too hard — Get_Line (Str, Last); puts line length in Last. But I'm pretty sure you can achieve the same result without using such exotic tools as Ada — for example, use char[100] in C++ without checking for end-of-string character :-)
 » 7 years ago, # |   0 It cost me too much time to learn basic syntax in wrong way (reading tutorials and documentations instead of cloning examples). Also forcing myself to fight against notepad and Custom Test makes this round funnier :D
 » 7 years ago, # |   -11 A bad language! :-&
 » 7 years ago, # | ← Rev. 2 →   0 I'm really enjoyed this contest (except for input/output statements)Thanks so much!! :P
 » 7 years ago, # |   +4 Want more of this kind of contests!
 » 7 years ago, # |   +3 Really enjoyed this round!! Thanks a lot!
 » 7 years ago, # | ← Rev. 2 →   +1 BTW, if you also liked Ada, you can solve problems at SPOJ, which has Ada compiler. :)
 » 7 years ago, # |   0 The round was really great and so interesting because the language was new to almost everyone Thank you very much dear nickolas Good luck !