5 ms·
Once on an old TI machine my friends code continually acted oddly. BASIC. We tried and tried to debug it. We got it down to a single if statement after ponderin
by donatj 11y ago
Once on an old TI machine my friends code continually acted oddly. BASIC. We tried and tried to debug it. We got it down to a single if statement after pondering for several minutes I erased the equality `=`, put it back, and ran it. Pure grasping at straws. Works perfectly. To this day I can't explain the magic equals. This thing had a very limited character set so a visually identical glyph is out of the question.
This magical equals haunts me to this day.
- varjag 11y agoI remember in some of 8-bit BASICs there were "color codes". Basically, invisible escape sequences, which could be however interpreted as numbers if encountered in the source text. Could be something along those lines.
- pgeorgi 11y agoOld BASIC implementations often stored the code in a tokenized form to reduce the memory the code needs and to slightly speed up interpretation. One fun issue on C64's BASIC was that you could force the interpreter to not tokenize lines, but they were printed verbatim on "list" - totally invisible to the user. Printing the line, then having BASIC parse the same output fixed the issue. Although the error was pretty obvious IIRC (some fatal interpreter error aborting operation). I'm not sure what the TI machines did. There may have been some odd tokenization error in that line and by rewriting it, you kicked off the parser which made the bug go away.