Author |
Message |
|
john massey
Advanced Newbie
Joined: 26 Jul 2009 Posts: 50
|
Posted: 29 Sep 2009 08:33:55 am Post subject: |
|
|
The special symbol will look like an L laid on its side with the long side on top. The length of the long side should be long enough to accommodate three numbers or four numbers, on the graph screen. I need two different symbols. The symbol should allow numbers to be placed just below the long side. The length of the short side should be able to display the height of the numbers.
See topic description for how the symbol will be used. |
|
Back to top |
|
|
Graphmastur
Advanced Member
Joined: 25 Mar 2009 Posts: 360
|
Posted: 29 Sep 2009 04:17:38 pm Post subject: |
|
|
Hey, just use Line function. |
|
Back to top |
|
|
john massey
Advanced Newbie
Joined: 26 Jul 2009 Posts: 50
|
Posted: 29 Sep 2009 07:26:44 pm Post subject: |
|
|
Hi Graphmastur,
I have had difficulty using the line functions. I have trouble with dealing with two different coordinate systems one for text statements and one using graph screen coordinates. I took me about half a day to get just them correct for 5 flash cards with the long lines that separated then and the short lines that go with each problem. The good news is that once this is done, I can use it in as many different sets of flash cards in as many different programs as I want to. I believe I can enter new values to a new set of flash cards in about an hour. When it comes to division which may be some months away, I have trouble dealing with two line statements, for each problem, one for a short horizontal line and one for a short vertical line. Then, there will be a mixture of multiplication and division, in the same set of flash cards. I want to be able to position the symbol discussed, just like I do the other symbols. like ? + - and X in text statements.
Is their any way that this can be done?
John |
|
Back to top |
|
|
FloppusMaximus
Advanced Member
Joined: 22 Aug 2008 Posts: 472
|
Posted: 29 Sep 2009 07:35:54 pm Post subject: |
|
|
As far as coordinates go, one handy trick is to do something like
Code: 0→Xmin
94→Xmax
-62→Ymin
0→Ymax
If you want any kind of automatic "pretty printing", you're going to have to write it yourself; the OS certainly doesn't provide any mechanism for doing so. You might look at Sebastian Theiss's Pretty Print app (which has a rather limited BASIC API, available by way of Symbolic.) Otherwise, I think you're on your own.
(Anyway, this topic does not belong in "Z80 & 68k Assembly".) |
|
Back to top |
|
|
Weregoose Authentic INTJ
Super Elite (Last Title)
Joined: 25 Nov 2004 Posts: 3976
|
Posted: 29 Sep 2009 08:12:04 pm Post subject: |
|
|
Topic moved.
Do we need to worry about the negative sign or decimal point in your numbers?
Last edited by Guest on 29 Sep 2009 08:12:36 pm; edited 1 time in total |
|
Back to top |
|
|
john massey
Advanced Newbie
Joined: 26 Jul 2009 Posts: 50
|
Posted: 30 Sep 2009 08:17:24 pm Post subject: |
|
|
Hi FloppusMaximus,
I just thought that would be done in assembly. Sorry about that.
You suggested that I might look at "Sebastian Theiss's Pretty Print app". Would you be specific and help on old newbie. Let me know where to find it. Is it well documented?
For Weregoose,
I have no perceived need for the negative sign or decimal point. I guess that I am in Basic developer now.
Thanks to both!
john |
|
Back to top |
|
|
Weregoose Authentic INTJ
Super Elite (Last Title)
Joined: 25 Nov 2004 Posts: 3976
|
Posted: 30 Sep 2009 09:43:19 pm Post subject: |
|
|
Then try this:
0→Xmin
94→Xmax
-62→Ymin
0→Ymax
1-34→U
12→V
384→A
195762→B
V+4+4int(log({A,B
Text(1-U,V,A,":",B
Line(Ans(1),U,Ans(1),U-5
Line(Ans(1),U,sum(Ans)-V,U
[EDIT] – Change that U-5 to a U-7 if you want the divisor to look a little more centered.
Last edited by Guest on 05 Jul 2010 07:57:01 am; edited 1 time in total |
|
Back to top |
|
|
john massey
Advanced Newbie
Joined: 26 Jul 2009 Posts: 50
|
Posted: 01 Oct 2009 05:56:10 am Post subject: |
|
|
Thanks, Weregoose
Wonderful! Do I see a light at the end of a tunnel?
With my limited knowledge, pardon me for asking these questions.
Can I make this code a little program and call that little program using the TEXT statement to position the symbol anywhere on the graph screen?
Which variable controls the length of the horizontal line? What pixel length is it set for now?
Same questions for height
john |
|
Back to top |
|
|
Weregoose Authentic INTJ
Super Elite (Last Title)
Joined: 25 Nov 2004 Posts: 3976
|
Posted: 01 Oct 2009 08:09:46 am Post subject: |
|
|
Everything from 34 to 195762 is fair game. Edit those values one at a time and see how it affects the behavior of the output. The intersection of both lines is positioned according to U, V, and the number of digits in A. From there, the length is automatically calculated from the number of digits in B, and the U-5 from earlier is the height. If you want to use your own set of variables and "call" (invoke) this subroutine from another program, then remove the lines where U, V, A, and B are being stored, replace these variables in the remainder of the lines with the letters that you want to use, and then put prgmNAME on the line of your main program where you want to display the text.
Example:
PROGRAM:SHOWCARD
:C+4+4int(log({M,N
:Text(1-R,C,M,":",N
:Line(Ans(1),R,Ans(1),R-7
:Line(Ans(1),R,sum(Ans)-C,R
:Pause
PROGRAM:FLSHCARD
:0→Xmin
:94→Xmax
:-62→Ymin
:0→Ymax
:…
:1-8→R
:40→C
:A→M
:B→N
:Pause "FLASHCARD READY!
:ClrDraw
:prgmSHOWCARD
:Disp "EXITING PROGRAM
That's row R, column C, divisor M, and dividend N. If you're keen on eliminating redundancy, you can just replace the M and N in the subroutine with your A and B, and omit storing to M and N in your main program altogether. On that note, try not to get too acquainted with the prgm token, either – if you plan to call the subroutine only once from inside your main program, then you might as well put the contents of the subroutine directly into your main program where you want it to be used!
[EDIT] – Forgot the ClrDraw instruction, went ahead and used R-7 as the default.
Last edited by Guest on 05 Jul 2010 07:57:23 am; edited 1 time in total |
|
Back to top |
|
|
john massey
Advanced Newbie
Joined: 26 Jul 2009 Posts: 50
|
Posted: 01 Oct 2009 12:55:26 pm Post subject: |
|
|
Hi, Weregoose,
I your fourth line of the FLSHCARD program there is a symbol. Based on your earlier comment I assume that this is a negative symbol. The reason is that there is a bug in the TI connect for the the use of minus and negative. If I want negative in the calculator I must use minus in TI connect. and vice versa. I spent about a week deciding what was going on.
I will use this routine in maybe 200 or 300 flash cards. As I see this, you no only making my symbol but also putting in the divisor and dividend as well. That is manna from heaven.
I use user "list names" for everything. The values for each item in the list is controlled by the loop counter. To be clear {1,2,3,4}-->NICE. Then NICE(I) would equal "3" in the third pass.
To make things clearer for me would you be kind enough to resent me your code with the insertion of all the variables I should use that can be stored in "list names". To help I suggest JOHN1 to JOHNN as appropriate. That way I can test to my hearts content.
Since you have saved me untold hours of misery, would you add a ? mark above the long horizontal line. It is my prompt. Then tell me the location of the ? mark relative to the variables so that I may put the correct answer in the same place relative. That way the child sees the ? mark and realizes that he / she is supposed to 1) decide on an answer 2) input the answer from the number from the number keys 3) then press "enter". By magic the ? mark is replaced by the correct answer, Even if it is wrong. If the answer is wrong the child then sees a OH message telling of the mistake, the correct answer and a score. If this is the first error and this is the forth pass, the score would by" 3/4". Properly done we will have the total solution for a complete division problem. All coded by "list names"
How cool is that.
john |
|
Back to top |
|
|
Weregoose Authentic INTJ
Super Elite (Last Title)
Joined: 25 Nov 2004 Posts: 3976
|
Posted: 01 Oct 2009 02:55:54 pm Post subject: |
|
|
Minus and negative, user-defined lists... A dead giveaway! Welcome to United-TI, John Massey. :)
I cannot disgrace my beautiful code by replacing all the variables with LJOHNN(n, because that would make the code slower and much more convoluted! What I will do is have you store your preferred {row,column,divisor,dividend} to a custom list of your choosing, and then extract those elements to the working variables just before the flashcard is shown:
PROGRAM:FLSHCARD
:…
:1-Lname(1→R
:Lname(2→C
:Lname(3→M
:Lname(4→N
:Pause "FLASHCARD READY!
Next, in prgmSHOWCARD, add →DIV to the end of line 1.
Now, you can write your question mark with: Text(-7-R,LDIV(1)+2,"? //negative 7, minus R
Last edited by Guest on 05 Jul 2010 07:57:42 am; edited 1 time in total |
|
Back to top |
|
|
john massey
Advanced Newbie
Joined: 26 Jul 2009 Posts: 50
|
Posted: 01 Oct 2009 08:17:31 pm Post subject: |
|
|
Hi Weregoose,
Presently I am getting five flash cards across the graph screen. In the more simple problems I want to be able to mix multiplication with division, since they are inverse functions. I would be nice if the code would only use "R" based on the number of digits in the dividend and one space for the divisor. Are you doing that now? If not can you? I can get 3 digits a space and the + sign in 5 problems. How big of a calculation can you get packed into that same space?
If I have followed your instructions correctly,and I a little studying of your code prior to doing what I did. Please advise
PROGRAM:SHOWCARD
:C+4+4int(log({M,N→DIV
:Text(-7-R,LDIV(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
PROGRAM:FLSHCARD
:0→Xmin
:94→Xmax
:-62→Ymin
:0→Ymax
:…
:1-8+LDX001(I)→R
:LDY001(I)→C
:LD1001(I)→M
:LD2001(I)→N
:Pause
:prgmSHOWCARD
:Disp "EXITING PROGRAM |
|
Back to top |
|
|
john massey
Advanced Newbie
Joined: 26 Jul 2009 Posts: 50
|
Posted: 02 Oct 2009 05:35:27 am Post subject: |
|
|
Hi Weregoose,
I woke up in the night and thought if:
1-8+LDX001(I)→R should just be
LDX001(I)→R
I would be nice if you added L to your special symbols as in LDX001
john |
|
Back to top |
|
|
john massey
Advanced Newbie
Joined: 26 Jul 2009 Posts: 50
|
Posted: 02 Oct 2009 12:13:52 pm Post subject: |
|
|
Hi Weregoose,
I built a little program to test your code as you suggested earlier. I used lists from my other program to make things easier.M=2,N=12 and the answer is 6.
I cannot get past the line of code where the cursor stops at the STO command.
ClrDraw
0→Xmin
94→Xmax
–62→Ymin
0→Ymax
12→R
–30→C
LFN001(20)→M
LSN001(1→N
(C+4+4int(log({M,N)→⌊DIV HERE
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: 02 Oct 2009 02:41:14 pm Post subject: |
|
|
If the cursor stops on the second line, then you need to go to mode and select FUNC. |
|
Back to top |
|
|
john massey
Advanced Newbie
Joined: 26 Jul 2009 Posts: 50
|
Posted: 02 Oct 2009 05:05:05 pm Post subject: |
|
|
FUNC was selected. Thanks anyway.
john |
|
Back to top |
|
|
Weregoose Authentic INTJ
Super Elite (Last Title)
Joined: 25 Nov 2004 Posts: 3976
|
Posted: 03 Oct 2009 03:03:16 pm Post subject: |
|
|
Hi johnuts,
I see you changed the storage method so that all rows are contained in one list, all columns in another, etc. Thanks for coming up with that before I did.
The line should be :1-LDX001(I). The 1- is there to map the row number from the list onto the appropriate y-coordinate so that we know where to draw the division bracket.
As for your other points, I'm left a little uncertain about what you mean by...
Quote: I would be nice if the code would only use "R" based on the number of digits in the dividend and one space for the divisor.
Maybe you could clear that up with a mock output that expresses how you want it to look in the end, perhaps with an extreme-case example.
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 05 Jul 2010 07:58:04 am; edited 1 time in total |
|
Back to top |
|
|
john massey
Advanced Newbie
Joined: 26 Jul 2009 Posts: 50
|
Posted: 03 Oct 2009 06:24:07 pm Post subject: |
|
|
Hi Weregoose,
Sorry for the ( ) around the code I tried a number of ways to get rid of the DOMAIN error. I forgot to take them off. I took them off and checked my code against yours. Still got DOMAIN error. Were I told you earlier.
You will note in the code I sent you I used 12-->R and-30-->C because I could not find values in other "list names" to use.
I want to be able to mix multiplication and division on the same screen, as I told you earlier.
I will try to explain about the "R" variable. When I make a line I, of course, use the line command. Visualize the length of the "L" laid so that the long part is parallel to the X axis. When I use two digits, I want the line to be just long enough to cover the two digits under it. Similarly I want the same effect for three digits. I do not know when I will run out of space for my 5 flash cards. Then I will have to go to a four flash cards, which is a pain to do. I am anticipating that we can get two digits under the line and still stay on a five flash card layout. Presently I can get three digits, a space and a + sign in each of my five flash cards, all in the same row. If I did a rotten job of explaining, I apologize. I will do anything I can to clarify. I could make a file in word but my experience has been rotten when I try to put that in a post. I looses any formatting that I may give it. __ Two digit problem. I have no idea what you
12
will get.
When I was about 12 years old, I worked at a small resort out side of the town I lived in Wisconsin,USA. The owner was from Italian decent. When He came looking for me he would yell JOHNUTS. So the story goes. Your trivia for the day.
JOHNUTS |
|
Back to top |
|
|
john massey
Advanced Newbie
Joined: 26 Jul 2009 Posts: 50
|
Posted: 04 Oct 2009 11:55:04 am Post subject: |
|
|
Hi Weregoose,
I will try something different
__
12
___
123
____
1234 |
|
Back to top |
|
|
Weregoose Authentic INTJ
Super Elite (Last Title)
Joined: 25 Nov 2004 Posts: 3976
|
Posted: 04 Oct 2009 11:58:59 am Post subject: |
|
|
The program already stretches the line to accommodate numbers of any length.
Also, I think your domain error was caused by taking the log( of zero.
Last edited by Guest on 05 Jul 2010 07:56:36 am; edited 1 time in total |
|
Back to top |
|
|
|