Thanks to everyone who has already participated or is going to participate in our programming competition !
We decided to publish a number of important clarifications to the rules to help participants avoid common mistakes. It would be a shame to disqualify an interesting decision because of a purely technical error.
By popular demand, we also publish an official script for testing . With the help of it, you can independently check whether your program works under the conditions of our test system. Run the script with no arguments to learn how to use it. ')
There is still a week to send the work. If this post helped you find an error, there is still time to correct it.
The English version of this post is posted on GitHub .
Frequently asked Questions
How can I read the words.txt file if the fs module cannot be loaded?Is it possible to download it from the Internet?Can I use process.binding ? Your program will not have access to the words.txt file. That's the point. If you could just read this file, the task would be trivial. Nothing can be downloaded, because it would require modules such as http or net . Include the dictionary in your decision also will not work due to size limitations. This means that writing a solution that always gives the correct answers is most likely impossible. But you can write a program that more often guesses correctly than wrong, and the one whose program more accurately guesses will win.
There are some capitalized words in the dictionary.Can they get caught in the tests? They can, but they will be converted to lower case.
What does 64 KiB mean? 64 * 1024 = 65536 bytes.
If my data file is compressed using the gzip method, should its size be before or after compression fit into 64 KiB along with the program text? Considered size after compression.
What a strange dictionary!It is full of some incomprehensible words. We know that he is strange. This is the largest dictionary of English for spelling, which includes a large number of abbreviations, borrowings, rare words, dialectisms and even impossible word forms. However, we chose this particular dictionary, so for this task the “English word” is the one that is found specifically in this dictionary.
What is the size of the “non-word” set used in the test generator? The test generator does not use any fixed set of "non-words". It generates pseudo-random words, similar to English, directly when requested by the algorithm, which we will publish when summing up the results of the competition.
How will the test system take into account duplicates, that is, words that occur in more than one of the blocks of 100 words? Each entry will be counted as a separate word. See how our script is designed for testing .
What if two people sent a link to the contest to the winner? The prize will receive the one who sent it first.
Typical mistakes
Unfortunately, many solutions that we have received to date contain similar technical errors:
The test and init functions are not exported or exported correctly. It is not enough just to declare the functions; they must be exported from the module. If you are not sure that you did it correctly, check your program with our test script .
The init function works with its data argument as a text string, whereas the condition explicitly states that it will be a Buffer .
The program uses a data file, but it is not attached.
The data file is packed using the gzip method, but the corresponding option is not selected in the send form.
The gzip option in the send form is selected, but the file instead of gzip is a zip archive. This is not the same thing!
The program tries to use require or process.binding . This is prohibited by the rules.