• Programmers use new missions against AI

Hi all!!! Checkio is back on the air, and we have something new for you! Today you will find a new selection of missions, the creators of which challenge you to test your skills. Let's talk a little about the artificial intelligence conspiracy, which may be dangerous for programmers (depending on how inclined you are to the idea "robots will conquer our planet"). And also remember the traditions in programming and good manners in writing code. Let's go!!!

NEW MISSIONS🐱‍👓

Nonogram Encode by freeman_lex - Your goal is to create a nonogram from the image: write a number clue for solving this image like it was hidden. Your function should return a list of two lists. The first one consists of lists with numbers for columns clue, the second one - the same for rows clue. All lists in columns clue, as well as in rows, should be of same 'depth' (complemented with 0).

nonogram_encode([" X X ", "X X X", " X X "]) == [
    [[0, 1, 0, 1, 0], [1, 1, 1, 1, 1]],
    [[0, 1, 1], [1, 1, 1], [0, 1, 1]],
]
nonogram_encode(["X"]) == [[[1]], [[1]]]

Missing Number by freeman_lex - You are given a list of integers, which are elements of arithmetic progression - the difference between the consecutive elements is constant. But this list is unsorted, and one element is missing. Your task is to determine which element is missing from the list.

missing_number([1, 4, 2, 5]) == 3
missing_number([2, 6, 8]) == 4

Duplicate Zeros by Doppelok - You are given a list of integers. Your task in this mission is to double all the zeros in the given list.

duplicate_zeros([1, 0, 2, 3, 0, 4, 5, 0]) == [1, 0, 0, 2, 3, 0, 0, 4, 5, 0, 0]
duplicate_zeros([0, 0, 0, 0]) == [0, 0, 0, 0, 0, 0, 0, 0]
duplicate_zeros([100, 10, 0, 101, 1000]) == [100, 10, 0, 0, 101, 1000]

NEWS💡

Can Amazon's Codewhisperer write better python than you? - Amazon’s CodeWhisperer is a machine-learning based coding assistant which is currently in beta. Amazon presented CodeWhisperer artificial intelligence in June this year. And today it supports such programming languages ​​as Python, Java, Java Script. CodeWhisperer models are trained on "a variety of data sources, including open source Amazon." AI can write code in 3 seconds that you would spend a day just reading documentation. It seemed like a terrifying competition. But you can breathe easy, this AI is not yet smart enough to enslave us. This article provides an overview and brief instruction on how you can make your life easier by enslaving AI (for now).🤖

The Zen of Python OR Education of a programmer - If you work with the Python programming language, then you should be familiar with this - “Zen of Python”. Tim Peters, a long-time pythonist, summarized the BDFL guidelines for Python development in the form of 20 aphorisms, only 19 of which have been written down. What are we talking about... The Checkio team frequently reviews your posted mission solutions on the platform, and some of them end up in the Editor's Choice Publications section. So, we can say that we, like no one else, see your development in the manner of writing code and how you grow in the logic of your decisions. Therefore, taking advantage of this opportunity, we considered it is not superfluous to remind once again what a real gentleman pythonist should strive for. And maybe AI will lose its war to programmers who follow the code! 🐱‍💻

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

It's time to solve some cool missions. AI will lose this battle!!! See you on CheckiO!🙌

Welcome to CheckiO - games for coders where you can improve your codings skills.

The main idea behind these games is to give you the opportunity to learn by exchanging experience with the rest of the community. Every day we are trying to find interesting solutions for you to help you become a better coder.

Join the Game