Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: Insorak on December 22, 2009, 02:09:59 pm

Title: String to List Glitch
Post by: Insorak on December 22, 2009, 02:09:59 pm
Calculator: TI-84+ SE, OS 2.43

So apparently, on this calculator, you can store a string to a list without getting a syntax error.

Code: [Select]
" →L1
There's lots of weird properties about this "glitch", and I have a few questions about it...

If you enter the code above on the homescreen, and then just enter L1, you get an ERR:SYNTAX. When you press Goto, it shows essentially what's in the codebox above. Some other times, you get an ERR:DATA TYPE instead of an ERR:SYNTAX. It's weird. Yet, if you do a Rcl on L1, you can get the former contents of L1, or an empty list ({}) if L1 is empty. How does this work in memory?

It screws up the list editor if you try to view it there (Stat → Edit). What's up with the weird diamond symbol that appears next to the list name?

How can this error even occur? Apparently TI wasn't smart enough to prevent us from storing strings to lists? :O
Title: Re: String to List Glitch
Post by: Builderboy on December 22, 2009, 02:44:51 pm
Well acctualy there is a reason for being able to store Strings to lists, it is a feature, not a glitch! :) Try storing "L2+2" to L1 and then store {1,2,3,4} into L2, if you access L1, you will see it will equal {3,4,5,6}.  The diamond you see means that that list cannot be changed or edited, as it is governed by an equation, and not an actual set of numbers.
Title: Re: String to List Glitch
Post by: ztrumpet on December 22, 2009, 03:14:20 pm
That's really cool! I might have to use this feature...
Title: Re: String to List Glitch
Post by: mapar007 on December 22, 2009, 03:47:02 pm
As builderboy says, it's not a glitch. It's the undocumented (?) list formula feature. Check asmin28, there's a reference to them in the chapter about the VAT.
Title: Re: String to List Glitch
Post by: Insorak on December 22, 2009, 03:52:24 pm
Ahh, okay. That's interesting.

I never knew about that. Stupid undocumented stuff.
Title: Re: String to List Glitch
Post by: mapar007 on December 22, 2009, 03:53:24 pm
Well, actually I'm not sure if it is undocumented... You should check the manual. (or I should do it myself :P )
Title: Re: String to List Glitch
Post by: DJ Omnimaga on December 22, 2009, 07:31:24 pm
There's stuff about it in the manual IIRC, I am sure I saw it, altough I never bothered to try
Title: Re: String to List Glitch
Post by: jsj795 on December 23, 2009, 04:42:01 pm
I saw those in TI83+ manual.
But I never used those
Title: Re: String to List Glitch
Post by: ztrumpet on December 23, 2009, 05:04:07 pm
What is the token (in hexadecimal) for the diamond like symbol, asm-ers?

Edit:
As builderboy says, it's not a glitch. It's the undocumented (?) list formula feature. Check asmin28, there's a reference to them in the chapter about the VAT.
That's pretty cool! For those who havn't looked yet and kinda-or-more understand Asm, check day 21 (in the lesson folder) of http://www.ticalc.org/archives/files/fileinfo/268/26877.html .
Title: Re: String to List Glitch
Post by: meishe91 on May 24, 2010, 04:26:59 pm
What about when you do something like "L2+2→Y? How does that work since you don't have the multi-number output a list does?
Title: Re: String to List Glitch
Post by: calcdude84se on May 24, 2010, 05:11:34 pm
it actually makes a list Y, just like {1,2,3,4->Y would
Title: Re: String to List Glitch
Post by: DJ Omnimaga on May 24, 2010, 05:21:33 pm
Yeah I remember now the L is optional when creating a list. The BASIC parser seems to detect if you try to store a list instead of variable
Title: Re: String to List Glitch
Post by: calcdude84se on May 24, 2010, 05:34:47 pm
Which makes Input commands so annoying, because they act the same. This strange behavior can also be interesting, as this (http://www.unitedti.org/forum/index.php?showtopic=9191) brainteaser contest shows
Title: Re: String to List Glitch
Post by: DJ Omnimaga on May 24, 2010, 05:38:14 pm
what kind of issue it can cause with Input that hinders people?
Title: Re: String to List Glitch
Post by: calcdude84se on May 24, 2010, 05:43:11 pm
Probably more accurate is that it can make Input more annoying, because if you wanted the user to input a real/complex number, they can input a list, and now you have a list that you're program probably doesn't ever use.
Title: Re: String to List Glitch
Post by: DJ Omnimaga on May 24, 2010, 05:47:27 pm
Oooh ok x.x. Is there a possible check to make sure the person won't input a list?
Title: Re: String to List Glitch
Post by: calcdude84se on May 24, 2010, 05:54:52 pm
not really. after inputting A, trying to see if LA exists may produce errors. I may be wrong, but I don't think it's possible in pure BASIC. All you can really do is preset A to some absurd value so it would just ask for input again anyway if someone input a list
For example:
Code: [Select]
Repeat A>=0 and not(fPart(A
-1->A
Input "Value: ",A
End
//Rest of code here
I'm assuming this program only accepts non-negative integers
Title: Re: String to List Glitch
Post by: DJ Omnimaga on May 24, 2010, 05:56:00 pm
mhmm I see :/

I guess then you need to put a warning in the readme (altough few people actually read those) so the user won't output a list so he wont risk running out of RAM or overwriting one of his list
Title: Re: String to List Glitch
Post by: Builderboy on May 24, 2010, 09:45:52 pm
What i would do is make sure the variable is a valid input before the user inputs anything, so if they try a list, it wont change the variable and they will be just directed to the default screen for inputting weird data :P
Title: Re: String to List Glitch
Post by: rthprog on May 25, 2010, 08:14:55 am
(less useful tip)
You can also do it from the editor. Just select the header, and type your function in with quotation marks.
Title: Re: String to List Glitch
Post by: Deep Toaster on May 28, 2010, 01:25:45 pm
That's really cool! I might have to use this feature...

I've found that it's really useful if you want to make a passcode feature, as for a puzzle game with a passcode for each level. Just do something like

:"randInt(1,26,10)E4+randInt(1,26,10)E2+randInt(1,26,10→PCODE

and you'll have a nearly unhackable 3-letter passcode for each level stored in list PCODE. Before accessing the password, you can even specify something like a key to decrypt it by having a

:[num]→rand

where [num] is some arbitrary integer. That way, the only way for the user to find the password is if he happens to know the key (i.e., the value of [num]).
Title: Re: String to List Glitch
Post by: DJ Omnimaga on May 28, 2010, 01:59:12 pm
I wonder if something similar could be used for save files? I know the guy who made the first xLIB Metroid in 2006 had a password-based save system, but I never checked if it was easily hackable or not. I myself never figured out how to do such save system.
Title: Re: String to List Glitch
Post by: Deep Toaster on May 28, 2010, 03:14:03 pm
I wonder if something similar could be used for save files? I know the guy who made the first xLIB Metroid in 2006 had a password-based save system, but I never checked if it was easily hackable or not. I myself never figured out how to do such save system.

If a list function were used, it'd be too easily hackable (since all the user has to do is go into the list editor and change the function to change his stats).