Nickolas's blog

By Nickolas, 10 years ago, translation, In English

The contest is over. 13 people solved all problems — you guys are amazing!

The editorial will be available here.


Today's language is FALSE, stack-based esoteric programming language invented over 20 years ago.

The traditional A+B problem (integers A and B are separated with a space) can be solved like this.

To test your solutions, you can:

  • download source code in C of the original interpreter here. Testing system uses this interpreter with -q option.
  • use "Custom Invocation".
  • use online interpreters (they differ from the reference interpreter a bit but make debugging much easier): 1, 2.

Useful links:

Notes:

  1. Language description contains instructions ø and ß. The reference interpreter uses O and B instead (both online interpreters support ø and ß).
  2. End of file is encoded as #-1, end of line — as #13#10.
  3. The stack MUST be empty when program completes, otherwise the interpreter will post an error to stdout, and output will be judged as incorrect.

Surprise Language Round #7 will take place on September 13th, the Programmers' Day.

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

I hope that the language I chose will be unknown to most of the competitors. For reference, here is the list of previous Surprise/Unknown Language Rounds.

Round Language
Friday the 13th, Programmers' Day Ada
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!

Announcement of Surprise Language Round 7
  • Vote: I like it
  • +153
  • Vote: I do not like it

| Write comment?
»
10 years ago, # |
  Vote: I like it +12 Vote: I do not like it

Is the language and instructions provided at the very start of the round or a little before? (like 5 or 10 min?)

This sounds fun :)

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

    A couple of minutes before the start. People need time to overcome the surprise :-)

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

      Waiting until the last second to release the language?

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

You might want to add the time of the contest (usual time, 15.30 UTC, according to the Contests page). Unless you want to make this Surprise Round to have a Surprise Start Time too.

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

    I dont think they want to test whether you log in frequently or not! This will needlessly reduce participation.

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

can install compiler in both linux and windows? or just one of them?

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

    Should be both, we're checking this now. You'll also be able to run your code online ("Custom Invocation" tab of the contest interface).

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

      but it's not User friendly (for me) !

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

        We are fully aware of people who refuse to use online compilers (although their reasons are a mystery to me). We do our best to make sure that compiler for the chosen language is available on all platforms. However, we cannot give a 100% guarantee of this, so we also provide alternative methods of running your code. Using "Custom Invocation" has an added benefit of running your code in the same conditions as your submission runs, which might be good for figuring out why your submission works locally but gets WA at the server.

        P.S. If you have a look at the languages used in previous rounds, you might notice that "user-friendly" is never part of the design :-)

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

So, where's the guy hoping for more maths ? :D

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

    Hope for the language to be TI Basic.

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

    Hope for the language to be C++.

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

      Well, that would be too surprising! :D

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

      The blog writer said this:

      I hope that the language I chose will be unknown to most of the competitors.

      So I don't think he will be choosing C++! :)

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

    AkshajK reports to duty .. hope for math..ematica!

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

Last contest, the surprise language is ADA, then I spent 2 hour in reading the introduction and the grammar of this language.... After I can write the "a+b" and "hello world!" in online compiler... the contest is over... A sad story...XD

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

I wish the language in this contest is whitespace...then we can see a lot of "empty" code...

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

The language of the problem statements will be unknown as well?

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

How can we know the syntax rules of your language ? Will you explain ; or are the languages currently known worldwide ?

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

    The language is "known" worldwide as in there should be a free documentation on the internet, which you can look up.

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

Kinda hope it'll be Assembly :D

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

MikeMirzayanov has registered for this contest :) It's going to be an exciting contest.

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

FALSE((

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

As if ADA was not bad enough :(

»
10 years ago, # |
  Vote: I like it -8 Vote: I do not like it

I think FALSE is not a programming language at all!!

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

    Not true. We have evidence of at least 80 contest participants now that it is possible to write a program in it :-)

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

What is this thing ... OMG !!!

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

I'm ready to work with Assembly instead of this FALSE programming language!

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

    You know a programming language is bad when you can sort an array by hand faster than you can code it even for input size n = 105

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

Input is underspecified; some problems end the input with a newline (and apparently #10 only, not #13#10), and others don't have a newline at the end of the input. This makes comparing whether we've found the EOF different (either 10 or -1).

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

    Aha, there were endl instead of EOF!

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

    Luckily the while condition is just slightly changed, you simply need to check for more than one symbol in it, and that's all. I didn't encounter any problems with the input ending with newline instead of EOF, I just started using this "improved" condition.

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

      Oh, right, I should have checked for characters less than 33 (EOF (-1), line feed (10), carriage return (13), space (32)) instead; I coded [^$10=~] as the condition and should have [^$32>~] instead.

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

        Or even shorter, [^$33<] :)

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

          < doesn’t exist.

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

            Yep, my bad. Double-checked my code, turns out I used >~ too, and now I remember why :)

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

    Awwww, this explains my "Wrong answer on test 1" in C!

    I haven't thought of that :(

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

Huge thank you for the contest, was fun as usual! Hopefully the next one will be sooner than a year from now.

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

    Hopefully the next one will feature a language that is more comprehendable and easier to code in. This one was a FALSE language.

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

      I think this language is fun to learn.

      The challenge is to code in a language that is completely different from what you used to code in.

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

Thanks a lot for the contest.

It was fun recollecting things about stack based programming. :-)

The language was actually fun once you get a hang of it. (Took me over 1 and a half hour)

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

Thanks for contest.

After being fun, I think trying to understand new library's and new languages in a short while is a good practice to face real ones.

PS: I wrote A & B directly and a c++ code generator for E CODE

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

Both sample test outputs in problem H (array sorting) are wrong:

The first one should be: "1 2 3 3" (there are 2 instances of "3")

The second one should be: "2 2 3 5 7 12 44 60" (the "7" was accidentally omitted).

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

    Please read problem statement.

    The input consists of a single line of space-separated integers. The first number is n (1 ≤ n ≤ 10) — the size of the array. The following n numbers are the elements of the array (1 ≤ ai ≤ 100).

    3 and 7 are array sizes, not array elements, and should not be sorted.

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

I think there is a mistake in the statement. End of file is encoded as #-1,which is correct,while end of line — not as #13#10 ,but just #10 (at least on Codeforces,tested in custom test). I write a program ^.^. and the input is a blank line(Just press enter in input box),and I get a output like 10-1 --there is no #13

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

    The problem is, custom test differs from what testing system does — custom test uses end-of-line that matches OS under which browser runs, but the testing system always uses #13#10.

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

      7786172

      If so, it's so weired that my submission for Problem D,which thinks that end of line consists of only one character,passed the system test.

      if a End-of-Line consists of 2 characters,after reading an integer, my code will get a #13 and thinks a integer end,and followed other chars,and the following loop will stop if the next char is not a letter,and the remaining #10 is not a letter,so my program will print nothing.

      BTW,I'm a windows user.

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

      msvcrt on Windows will do some automatically conversion between "\r\n" (Windows line ending) and "\n" (Unix line ending) when reading and writing. (If the stream is opened as text-mode, which is default)

      That is to say, even if the input file is in Windows line ending (CRLF, or "\r\n"), the program which uses msvcrt's I/O functions could only see a single "\n".

      Seems like the whole Codeforces judging system is based on Windows, and the interpreter is written in C, linked to msvcrt.

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

Thanks for the great contest! I always enjoy these and this one was no exception.

end-of-line issues were pretty frustrating to me; I think #10 ('\n') is a more standard end-of-line character than #13#10 (which is apparently "vertical tab" and then a "newline"??). Two characters at end of line is weird...

I guess this way was more convenient for Windows users?

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

I did not realize there were variables in the language until after I did A,B,D,E. Oops...