5int(.1x)+10fpart(.1x)-6 works for everything except the 3rd row. when pressing alpha, i end up with 11, meaning right arrow, so that pushes the whole row to the right by 1. i believe the problem is that right arrow is the only 6th element of any key press row. does anyone have a better formula?

That will return 0 to 49 for the keys without the 35 key (the one that would be after the down key) and without making the right arrow and Alpha be the same key.

47%? Take a look and try to imagine how cool 100% will be. This has won zContest 2011 and made news on TICalc. This compromise between Assembly and BASIC parses like BASIC and is fast like assembly. Grammer 2

The last part strips away the 26 and makes a 35 out of it. The whole line will generate all numbers 1 through 50, but not in the order you'd expect, meaning you'll have to reposition the string's "elements" to match.