This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. TI-Basic => TI-BASIC
United-TI Archives -> TI-Basic
 
    » Goto page Previous  1, 2
» View previous topic :: View next topic  
Author Message
john massey


Advanced Newbie


Joined: 26 Jul 2009
Posts: 50

Posted: 05 Oct 2009 08:33:12 am    Post subject:

M=2=divisor
N=12=dividend
SN001(7)=6

Where does the Log of zero get here? Where did I screw up?
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 05 Oct 2009 12:26:33 pm    Post subject:

I see what it is. Text(1-R,C,M,":",N doesn't work after –30→C. Nonnegative column numbers only! Smile

Last edited by Guest on 05 Jul 2010 07:56:08 am; edited 1 time in total
Back to top
john massey


Advanced Newbie


Joined: 26 Jul 2009
Posts: 50

Posted: 05 Oct 2009 04:38:46 pm    Post subject:

modified code as requested.

ClrDraw
0→Xmin
94→Xmax
62→Ymin
0→Ymax
12→R
12→C
LFN001(20)→M
LSN001(1Cool→N
C+4+4int(log({M,N→⌊DIV //problem persists cursor flashes on the STO command
Text(-7-R,⌊DIV(1)+2,"?
Text(1-R,C,M,":",N
Line(Ans(1),R,Ans(1),R-7
Line(Ans(1),R,sum(Ans)-C,R
Text(-7-R,⌊DIV(1)+2,⌊SN001(7)
Disp "EXITING PROGRAM
Back to top
ztrumpet


Active Member


Joined: 06 May 2009
Posts: 555

Posted: 05 Oct 2009 04:50:52 pm    Post subject:

It will error if M or N equals zero.
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 05 Oct 2009 08:11:03 pm    Post subject:

ztrumpet wrote:
It will error if M or N equals zero.
Yes, but zero they aren't (as per his earlier reply). ;)

Text(1-R,C,M,":",N won't work when R is greater than one. When you modified the code, you had the misfortune of removing 1- from the →R; it served the purpose of translating positive numbers from the row list into negative y-coordinates for the lines. By storing a positive number there, you're having the calculator write lines above the graphing window and write text to rows that don't exist! The easiest solution here is to put the 1- back to where it needs to go, but if you're looking to keep R and C as what they are permanently, then you might as well substitute their values where they exist in the code...

ClrDraw
0→Xmin
94→Xmax
–62→Ymin
0→Ymax
(1-12)→R
(12)→C
LFN001(20)→M
LSN001(1Cool→N
(12)+4+4int(log({M,N→LDIV
Text(-7-(1-12),LDIV(1)+2,"?
Text(1-(1-12),(12),M,":",N
Line(Ans(1),(1-12),Ans(1),(1-12)-7
Line(Ans(1),(1-12),sum(Ans)-(12),(1-12)
Text(-7-(1-12),LDIV(1)+2,LSN001(7)
Disp "EXITING PROGRAM

...and then simplify:

ClrDraw
0→Xmin
94→Xmax
–62→Ymin
0→Ymax
LFN001(20)→M
LSN001(1Cool→N
16+4int(log({M,N→LDIV
Text(4,LDIV(1)+2,"?
Text(12,12,M,":",N
Line(Ans(1),-11,Ans(1),-18
Line(Ans(1),-11,sum(Ans)-12,-11
Text(4,LDIV(1)+2,LSN001(7)
Disp "EXITING PROGRAM


Last edited by Guest on 05 Jul 2010 07:55:47 am; edited 1 time in total
Back to top
john massey


Advanced Newbie


Joined: 26 Jul 2009
Posts: 50

Posted: 06 Oct 2009 07:00:06 am    Post subject:

I want to make the list names work. I have reviewed all of our correspondence. As you can see I have given all the list names a value so you will know what I have done. When the program bombed I checked the values of the variables. R=-4, C=6, M=2, N=12

ClrDraw
0→Xmin
94→Xmax
62→Ymin
0→Ymax
{5}→⌊RN999
1-⌊RN999(1)→R
{6}→⌊CN999
⌊CN999(1)→C
{2}→⌊FN999
⌊FN999(1)→M
{12}→⌊SN999
⌊SN999(1)→N
(C+4+4int(log({M,N)→⌊DIV//the program bombed here with the cursor sitting on ")"
Text(-7-R,⌊DIV(1)+2,"?
Text(1-R,C,M,":",N
Line(Ans(1),R,Ans(1),R-7
Line(Ans(1),R,sum(Ans)-C,R
Text(-7-R,⌊DIV(1)+2,"6"
Disp "EXITING PROGRAM
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 06 Oct 2009 01:10:24 pm    Post subject:

With those numbers, there cannot possibly be a domain error. Although, I still see a syntax error with those parentheses!

Weregoose wrote:
Finally, when you say that the cursor stops at that line, is there an error there? What kind of error was it? Whatever the case, those parentheses on the sides shouldn't even be there; if they are, then they're the cause of your trouble. The calculator last sees a "{" and hopes to pair it with a matching "}" before any other kind of closing bracket is encountered.


Last edited by Guest on 06 Oct 2009 01:10:54 pm; edited 1 time in total
Back to top
john massey


Advanced Newbie


Joined: 26 Jul 2009
Posts: 50

Posted: 06 Oct 2009 03:48:07 pm    Post subject:

fixed. LDIV yields {10 14} Fixed code

ClrDraw
0→Xmin
94→Xmax
62→Ymin
0→Ymax
{5}→⌊RN999
1-⌊RN999(1)→R
{6}→⌊CN999
⌊CN999(1)→C
{2}→⌊FN999
⌊FN999(1)→M
{12}→⌊SN999
⌊SN999(1)→N
C+4+4int(log({M,N→⌊DIV
Text(7-R,⌊DIV(1)+2,"? //DATA TYPE ERR cursor sets after ?
Text(1-R,C,M,":",N
Line(Ans(1),R,Ans(1),R-7
Line(Ans(1),R,sum(Ans)-C,R
Text(-7-R,⌊DIV(1)+2,"6"
Disp "EXITING PROGRAM
Back to top
ztrumpet


Active Member


Joined: 06 May 2009
Posts: 555

Posted: 06 Oct 2009 05:00:17 pm    Post subject:

It's erroring because -7-R is less than 0.
Back to top
john massey


Advanced Newbie


Joined: 26 Jul 2009
Posts: 50

Posted: 07 Oct 2009 11:10:53 am    Post subject:

This code works fine. Only one problem. R controls columns and C controls rows. You will notice that CN is set for "1" and the problem sets tight up against the left side of the screen. You will note that RN is set for "40" and the problem sets about 3/4 down the side of the screen. Do I just reverse R and C in all the print statements?

ClrDraw
ClrList⌊DIV
prgmLAYOUT1
0→Xmin
94→Xmax
62→Ymin
0→Ymax
{40}→⌊RN999
1-⌊RN999(1)→R
{1}→⌊CN999
⌊CN999(1)→C
{2}→⌊FN999
⌊FN999(1)→M
{12}→⌊SN999
⌊SN999(1)→N
C+4+4int(log({M,N→⌊DIV
Text(7-R,⌊DIV(1)+2,"?
Text(1-R,C,M,":",N
Line(Ans(1),R,Ans(1),R-7
Line(Ans(1),R,sum(Ans)-C,R
Pause
Text(7-R,⌊DIV(1)+2,"6"
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 07 Oct 2009 12:43:51 pm    Post subject:

Imagine a library wall containing 63 rows of books. To make your selection, you traverse these up and down, and then sideways. (Rows are stacked on top of each other. Remember that, and you should be fine.)

Last edited by Guest on 07 Oct 2009 01:34:36 pm; edited 1 time in total
Back to top
john massey


Advanced Newbie


Joined: 26 Jul 2009
Posts: 50

Posted: 07 Oct 2009 02:03:03 pm    Post subject:

What ever happened to rows X axes, that is parallel to the top of the screen and Y axis parallel to the side of the screen. Hay, like graph paper on a graph screen.
Back to top
john massey


Advanced Newbie


Joined: 26 Jul 2009
Posts: 50

Posted: 09 Oct 2009 06:31:53 am    Post subject:

This a sort of a final report. I decided to use your method of dealing with lines. Since I will need to change that when I get to division. It took me about a day, to make the changes. I then tried to integrate you division code into my big program. I just finished making the changes this morning. Since I will want to change the values of the "I" counter as more divisions occur in the flash cards, I included the code in the program. The code to print the answer is elsewhere in the program. You will notice the reference to FY with R and FX with C. Smile. Old habits die hard. Smile Any way here is the final code. I want to express my heart felt thanks for all your wonderful work. You have been very patient with this 79 year old, with limited skills.

ClrList⌊DIV
1-⌊FY001(20)→R
⌊FX001(20)→C
⌊FN001(20)→M
⌊SN001(20)→N
C+4+4int(log({M,N→⌊DIV
Text(7-R,⌊DIV(1)+2,"?
Text(1-R,C,M,":",N
Line(Ans(1),R,Ans(1),R-7
Line(Ans(1),R,sum(Ans)-C,R
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    » Goto page Previous  1, 2
» View previous topic :: View next topic  
Page 2 of 2 » All times are UTC - 5 Hours

 

Advertisement