Nickolas's blog

By Nickolas, 5 years ago, translation, In English,

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;
use 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!

 
 
 
 
  • Vote: I like it  
  • +230
  • Vote: I do not like it  

»
5 years ago, # |
Rev. 2   Vote: I like it -9 Vote: I do not like it

How about including this to your blog ? :)
Edit : so what's wrong?

»
5 years ago, # |
  Vote: I like it -26 Vote: I do not like it

What does it mean it is unrated?

  • »
    »
    5 years ago, # ^ |
    Rev. 3   Vote: I like it +1 Vote: I do not like it

    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).

  • »
    »
    5 years ago, # ^ |
    Rev. 2   Vote: I like it -28 Vote: I do not like it

    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!

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

We missed april fool contest... First i thought it'll be like that

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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 ...

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +51 Vote: I do not like it

    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 :)

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it +1 Vote: I do not like it

      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 ,

      • »
        »
        »
        »
        5 years ago, # ^ |
          Vote: I like it -20 Vote: I do not like it

        not exactly, there are possibilities that someone has mastered such surprise language before the contest announcement.

  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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...

»
5 years ago, # |
  Vote: I like it +8 Vote: I do not like it

We see cobol in surprise language round #5, It's a programming language in BigFrame... The round looks interesting...

»
5 years ago, # |
  Vote: I like it +13 Vote: I do not like it

Thx for unusual event

»
5 years ago, # |
  Vote: I like it +8 Vote: I do not like it

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!

»
5 years ago, # |
  Vote: I like it +9 Vote: I do not like it

It's the (1<<8)th day of the year! Happy programmers Day to all.

»
5 years ago, # |
  Vote: I like it +2 Vote: I do not like it

Unknown Language? Sounds COOL!

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

How early will the language be announced?

»
5 years ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

Let's play guess which langue is gonna be.

My guess (although it's a weak one) : Brainf*ck

»
5 years ago, # |
  Vote: I like it +2 Vote: I do not like it

Is there a compiler for Linux? Give instructions how to install it.

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

when will the announce is attach?

»
5 years ago, # |
  Vote: I like it +1 Vote: I do not like it

When the language will be announced ???

Waiting... :(

  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    "Please reread this post at the beginning of the contest"

»
5 years ago, # |
  Vote: I like it -9 Vote: I do not like it

It's Friday the 13th. What could possibly go wrong? ... ;)

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

"The round has 6 problems"

I just knew that there are 6 elements in {A, B, C, D, E, F, G}.

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +35 Vote: I do not like it

    I felt that announcing 6 problems and giving 7 feels like a nice surprise and much better than the other way around :-)

»
5 years ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

"...and links to useful manuals". Can't see them!!!

»
5 years ago, # |
  Vote: I like it +5 Vote: I do not like it

The language is so hard! Especially when you have not material!

»
5 years ago, # |
  Vote: I like it +15 Vote: I do not like it

http://www.infres.enst.fr/~pautet/Ada95/a95list.htm

This is a much more interesting resource than wiki, wiki just assumes you already know how to put everything together to make some sense.

»
5 years ago, # |
  Vote: I like it +3 Vote: I do not like it

"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").

»
5 years ago, # |
  Vote: I like it +78 Vote: I do not like it

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!

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +14 Vote: I do not like it

    I'm very impressed with your performance — and thank you for making each problem solveable during the contest :-)

»
5 years ago, # |
  Vote: I like it +21 Vote: I do not like it

Thank you for yet another wonderful surprise language contest!

»
5 years ago, # |
  Vote: I like it +14 Vote: I do not like it

Quite a fun round :-) Makes you appreciate the languages you actually work in :-) Please have another secret round match soon! :-)

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +9 Vote: I do not like it

    Number of programming languages is limited, it's better not to conduct such competitions too often :)

»
5 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Thank You For Your Wonderful Contest...

I think there is an error in judge system for me...

Link

When I use custom test in Test #5 i get output the 0.23478 and right answer ...

Please take a look at this ...

  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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.

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +13 Vote: I do not like it

    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.

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it +12 Vote: I do not like it

      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 ;)

      • »
        »
        »
        »
        5 years ago, # ^ |
          Vote: I like it +1 Vote: I do not like it

        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 :-)

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
5 years ago, # |
  Vote: I like it -11 Vote: I do not like it

A bad language! :-&

»
5 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

I'm really enjoyed this contest (except for input/output statements)

Thanks so much!! :P

»
5 years ago, # |
  Vote: I like it +4 Vote: I do not like it

Want more of this kind of contests!

»
5 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Really enjoyed this round!! Thanks a lot!

»
5 years ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

BTW, if you also liked Ada, you can solve problems at SPOJ, which has Ada compiler. :)

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

The round was really great and so interesting because the language was new to almost everyone Thank you very much dear nickolas Good luck !