Extended Straddling Checkerboard: Difference between revisions
→{{header|jq}}: more idiomatic version of decode
(→{{header|jq}}: more idiomatic version of decode) |
|||
Line 118:
def decode:
{s: .}
|
| .res = ""
| .figs = false
| until (.
| .ix = -1
| if .figs
then if
then .res += $c
else .figs = false
end
| .
else .ix = (drow1|index($c))
| if .ix and .ix >= 0
then .res += .dmap[drow1[.ix:.ix+1]]
| .
elif $c == "6"
then .res += "CODE" +
| .
elif $c == "7" or $c == "8"
then
| .res += .dmap[$c + $d]
| .
elif $c == "9"
then
| if $d == "0"
then .res += " "
Line 154 ⟶ 152:
else .res += .dwords[$c + $d]
end
| .
end
end )
|