Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
10
Task/Binary-strings/Jq/binary-strings-1.jq
Normal file
10
Task/Binary-strings/Jq/binary-strings-1.jq
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# If the input is a valid representation of a binary string
|
||||
# then pass it along:
|
||||
def check_binary:
|
||||
. as $a
|
||||
| reduce .[] as $x
|
||||
($a;
|
||||
if $x | (type == "number" and . == floor
|
||||
and 0 <= . and . <= 255) then $a
|
||||
else error("\(.) is an invalid representation of a byte")
|
||||
end );
|
||||
Loading…
Add table
Add a link
Reference in a new issue