Extended Straddling Checkerboard: Difference between revisions
Changed task description (as discussed in Talk Page) and amended the Wren entry accordingly.
(→{{header|Phix}}: moot point tweaks) |
(Changed task description (as discussed in Talk Page) and amended the Wren entry accordingly.) |
||
Line 5:
Implement encoding and decoding of a message using the extended straddling checkerboard, CT-37w, as described in the reference below.
You may switch the codes for F/L (99) and SUPP (98) to help differentiate the code for '9' from that of '999' and,
<pre>
A E I N O T CODE
Line 20:
0 1 2 3 4 5 6 7 8 9
</pre>
Line 410:
=={{header|Wren}}==
{{libheader|Wren-str}}
<syntaxhighlight lang="wren">import "./str" for Str
Line 457 ⟶ 456:
if (efigs.contains(c)) {
if (figs) {
add = add + c *
} else {
figs = true
add = add + fsl + c *
}
} else {
Line 494 ⟶ 493:
if (s[i..i+1] != fsl) {
res = res + c
▲ i = i + 3
} else {
figs = false
i = i + 2▼
}
} else if ((ix = drow1.indexOf(c)) >= 0) {
res = res + dmap[drow1[ix]]
Line 539 ⟶ 537:
Encoded:
0727923909290884848290949190629190979073848257518290982200000098909990549075819070889098119890790827175
Decoded:
|