As a couple of people may have noticed lately, I've largely abandoned development of Braingolf because it's boring and uninspired, and moved on to 2Col which is a little more interesting, and not designed to be a golfing language.
The defining feature of 2Col is that every line of code must be exactly 2 characters long, excluding the newline. This means that the length of a 2Col program can always be calculated as
n is the number of lines in the program.
So here's my challenge: Given 2Col code as a string, output truthy if it is valid 2Col code (Every line is exactly 2 characters and it conforms with the
3n-1 formula), and falsey otherwise.
Input should be taken as a single string, or an array of characters.
A truthy value if the input string is valid layout, and a falsey value otherwise.
Your code should be consistent in which truthy/falsey values it uses
====== F! $^ ---- truthy ====== ====== *8 +1 Sq ---- truthy ====== ====== nop xt ---- falsey ====== ====== +1 +1 #^ ---- falsey ====== ====== <empty string> ---- falsey ====== ====== ye ---- truthy ====== ====== no<space> ---- falsey ====== ====== test ---- falsey ====== ====== puzzle ---- falsey ======
This is code-golf so fewest bytes wins!