I prefer Unicode.
Code length is usually counted in characters (Unicode code points), though some contests use bytes.
My preference is to transcode the TI-83 program into Unicode, then count Unicode code points. For example, this golfed program by mellamokb has 41 characters:
:Prompt A,B,C
:(C-B)/(B-A→M
:Disp M,B-A*M
The store arrow →
becomes U+2192 RIGHTWARDS ARROW, and the triangle ▶
in operators like ▶Frac
and P▶Rx(
becomes U+25B6 BLACK RIGHT-POINTING TRIANGLE. For Greek letters, pi π
is U+03C0 GREEK SMALL LETTER PI and theta θ
is U+03B8 GREEK SMALL LETTER THETA. For exponents, square ²
is U+00B2 SUPERSCRIPT TWO and inverse ⁻¹
is U+207B SUPERSCRIPT MINUS, U+00B9 SUPERSCRIPT ONE. Negation ⁻
is U+207B SUPERSCRIPT MINUS. The root operator ˣ√
is U+02E3 MODIFIER LETTER SMALL X, U+221A SQUARE ROOT. The function ₁₀^(
is U+2081 SUBSCRIPT ONE, U+2080 SUBSCRIPT ZERO, U+005E CIRCUMFLEX ACCENT, U+0028 LEFT PARENTHESIS.
If I must count bytes, I may pick any encoding, such as UTF-8 or UTF-16, that includes enough characters for my program. So I pick UTF-8 if it takes the fewest bytes. Some, but not all, TI-BASIC programs fit in ISO-8859-7, an 8-bit Greek encoding. Pi π
is 2 bytes in UTF-8 but only 1 byte in ISO-8859-7. ISO-8859-7 lacks characters like the store arrow →
, but if my program has no store arrows, I might count ISO-8859-7 bytes.
What is a TI-83 character?
In the calculator manual for a TI-83 Plus, page 15-8 says:
Note: An instruction or function name, such as sin( or cos(, counts as as one character.
This definition is clear. Each instruction, like If
or While
, is one character in the calculator. Each function, like tan⁻¹(
, and each operator, like nPr
, is one character in the calculator.
The length(
function in the catalog can answer all questions about character count. length(" nPr ")
returns 1, so nPr
is one character.
I cannot answer questions about byte count. The calculator seems to have more than 256 characters, so I reject the idea that each character fits in a byte of 8 bits. Anyone who says that sin(
is 4 characters and 1 byte is wrong about the characters, and might be wrong about the bytes. The calculator might use a multibyte encoding, or it might use a larger byte size, like 12 bits.
I prefer to count Unicode characters, not calculator characters. For bytes, I prefer to encode the Unicode characters in UTF-8 or perhaps ISO-8859-7.
then
. So unless you can actually validly use 1 character, I would not count it as such. \$\endgroup\$