Which display do you think looks better? |
The big letters (like on the HomeScreen) |
|
44% |
[ 8 ] |
The small letters (like on the GraphScreen) |
|
55% |
[ 10 ] |
|
Total Votes : 18 |
|
Weregoose
I'm more worried about getting it to work the way it is right now. Later, I'll add some tests for the "+" or "-". But thanks for the reminder
I was assuming that he was going to do something like a find-replace of "-" with "+{-}", where {-} is the superscripted negative sign.
Would inString(Str1,"+{-}") mean that it's finding where "+" is, and if not there, it searches where "{-}" is?
Figure out a good test to answer this, and let the results do the talkin'.
True. But, right now, I'm replacing all of the inString( functions of a line (pretty long) to the real numbers they represent. I need to solve a dim error
TI_Coder wrote:
True. But, right now, I'm replacing all of the inString( functions of a line (pretty long) to the real numbers they represent. I need to solve a dim error
Any progress with solving said error? Hopefully you're not still banging your head into the issue over five days later.
I have actually solved the issue. I guess I just forgot to update you guys on the matter. Thanks for the help
TI_Coder wrote:
I have actually solved the issue. I guess I just forgot to update you guys on the matter. Thanks for the help
Sure thing, glad to hear that you solved the problem. Please continue to keep us up to date on progress and on anything on which you're stuck and would care for some spare brains.
Alright. As about 124 of you know, I have written prgmINPUT, which prompt the user for input. As of now, it's kind of slow.
Code: Lbl 1
getKey->A
If A=0
Goto 1
If A=22
Str1+"X->Str1
...
Goto 1
Is there anything I can do to get a much faster result?
Well yeah, you use a loop:
Code: Repeat [escape condition]
Repeat A
getKey->A:End
If A=22
Str1+"X->Str1
...
End //jump back to first repeat
So...
Code: Repeat A=105
Repeat A
getKey->A:End
If A=22
Str1+"X->Str1
...
...will work?
You left off the final End, but yes. Just be sure not to Goto out of that. Are you actually unfamiliar with the use of While/Repeat loops? If so, you should learn them ASAP so that you can write better, smaller, and faster programs.
Ok, so at the end of all of my If A=number: Str1+"blah->Str1, I would add an "End" to complete the Repeat? I see it now
TI_Coder wrote:
Ok, so at the end of all of my If A=number: Str1+"blah->Str1, I would add an "End" to complete the Repeat? I see it now
Correct. Repeat means "Repeat this loop between here and the matching End until [Condition] becomes true". While, by contrast, is "While [Condition] is true, repeat this loop between here and the matching End."
Ok. Thanks for clearing that up for me
Ok, I tried what you suggested, but when I press a button, nothing happens...
Code:
:" →Str1
:If ∟INPUT(1=1
:Then
:Text(∟INPUT(2),0,Str0,":",Str1,"
:Repeat A=105 and lengh(Str1>1
:Repeat A
:getKey→Z:End
:If Z=23 and length(Str1)>1
:sub(Str1,1,length(Str1)-1→Str1
:If Z=32
:Str1+"X→Str1
:If Z=45 and length(Str1)>1
:" →Str1
:If Z=51
:Str1+"{^-1}→Str1
:If Z=52
:Str1+"sin(→Str1
:If Z=53
:Str1+"cos(→Str1
:If Z=54
:Str1+"tan(→Str1
:If Z=55
:Str1+"^→Str1
:If Z=61
:Str1+"{^2}→Str1
:If Z=63
:Str1+"(→Str1
:If Z=64
:Str1+")→Str1
:If Z=65
:Str1+"/→Str1
:If Z=71
:Str1+"log(→Str1
:If Z=72
:Str1+"7→Str1
:If Z=73
:Str1+"8→Str1
:If Z=74
:Str1+"9→Str1
:If Z=75
:Str1+"*→Str1
:If Z=81
:Str1+"ln(→Str1
:If Z=82
:Str1+"4→Str1
:If Z=83
:Str1+"5→Str1
:If Z=84
:Str1+"6→Str1
:If Z=85
:Str1+"-→Str1
:If Z=92
:Str1+"1→Str1
:If Z=93
:Str1+"2→Str1
:If Z=94
:Str1+"3→Str1
:If Z=95
:Str1+"+→Str1
:If Z=102
:Str1+"0→Str1
:If Z=103
:Str1+".→Str1
:If Z=104
:Str1+"{-}→Str1
:End
:End
:If ∟INPUT(1=1
:Then
:End
:Lbl 2
:sub(Str1,2,length(Str1)-1)→Str1
You do the Text() output outside of the loop; surely you could have spotted that.
How about this? I took out all the list stuff that made no sense in context.
Code: :" →Str1
:Repeat A=105 and 1<length(Str1
:Text(∟INPUT(2),0,Str0,":",Str1,"
:Repeat A
:getKey→Z:End
:If Z=23 and 1<length(Str1
:sub(Str1,1,length(Str1)-1→Str1
:If Z=32
:Str1+"X→Str1
:If Z=45 and 1<length(Str1
:" →Str1
:If Z>50 and Z<105:Then
:sub("{^-1}sin(cos(tan(^{^2}F()/log(789*ln(456-F123+F0.{-}F",10fPart(.1Z)+5iPart(.1Z-5),1
:If Ans=/=F:Str1+Ans→Str1
:End
:End
:End
:sub(Str1,2,length(Str1)-1→Str1
Okay, I see a bit of room for improvement in that code, TI_Coder. I'll just address the impressively long list of conditionals.
Here's a nice optimization:
Code:
<rest of code>
" →Str1
If Z>50 AND Z<105
Str1+Sub("{^-1}sin(cos(tan(^{^2}()/log(789*ln(456-123+0.{-}",Z-50,1→Str1
<rest of code>
EDIT: Won't work as Kerm pointed out because of the jump in numbers.
Besides the missing 56-60, 66-70, 76-80, etc, you also have to handle the keys that don't have a character, so there's two types of skips to handle. I think my code properly deals with it.
With 25fPart(.04Z)+6(Z>55), you can map your getKey numbers...
Code: 51 52 53 54 55
61 62 63 64 65
71 72 73 74 75
81 82 83 84 85
91 92 93 94 95
101 102 103 104 105
...to 1–30, in this order:
Code: 01 02 03 04 05
17 18 19 20 21
27 28 29 30 06
12 13 14 15 16
22 23 24 25 26
07 08 09 10 11
Consequently:
Code: "{^-1}sin(cos(tan(^*?0.{-}?ln(456-²?()/?123+log(789"
Innocently, the expression yields seven for Z=32 as well as Z=101. With [ON] unusable, you can freely repurpose that value for [X,T,θ,n]:
Code: :If Z=32 or Z>50
:Then
:sub("{^-1}sin(cos(tan(^*X0.{-}?ln(456-²?()/?123+log(789",25fPart(.04Z)+6(Z>55),1
:If Ans≠"?
:Str1+Ans→Str1
:End