Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 101 users online: 9 members, 68 guests and 24 bots. Members: DShiznit, gbl08ma, GISdude, HOMER-16, Link, Spyro543, tifreak8x. Bots: Spinn3r (1), MSN/Bing (1), VoilaBot (1), Googlebot (19), MSN/Bing (2).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
|
| Author |
Message |
|
Spenceboy98

Super-Expert

Joined: 06 Jan 2012 Posts: 826 Location: In the TARDIS
|
Posted: 18 Apr 2012 09:27:44 pm Post subject: Quadratic Foactorizer |
|
|
I'm making a program to factor quadratic formulas, but I can't get it to do negative numbers. I post my code here:
Code: :ClrHome
:Input "A=",A
:Input "B=",B
:Input "C=",C
:ClrHome
:0→G
:If B{^2}-4AC<0
:Then
:Disp "No Solution"
:Pause
:ClrHome
:Stop
:End
:If A>0
:Then
:A-1→D
:A→I
:A→K
:End
:If A<0
:Then
:A-1→D
:A→I
:0→K
:End
:If C>0
:Then
:C-1→E
:C→J
:C→L
:End
:If C<0
:Then
:C-1→E
:C→J
:0→L
:End
:For(H,{-}5000,5000)
:If D*I=A
:Then
:Goto Z
:End
:If I=K
:Then
:D+1→D
:{-}A-1→I
:End
:I+1→I
:End
:Lbl Z
:For(H,{-}5000,5000
:If E*J=C
:Then
:Goto Y
:End
:If J=L
:Then
:E+1→E
:{-}C-1→J
:End
:J+1→J
:End
:Lbl Y
:Output(1,2,"(
:Output(1,3,D
:Output(1,5,"X
:Output(1,6,"+
:Output(1,8,J
:Output(1,10,")
:Output(2,2,"(
:Output(2,3,I
:Output(2,5,"X
:If B>0
:Then
:Output(2,6,"+
:End
:If B<0
:Then
:Output(2,6,"-
:End
:Output(2,8,E
:Output(2,10,")
:Pause
:ClrHome
Can someone help me with the negative numbers? I can't figure it out. |
|
| Back to top |
|
|
DJ_O

Retired TI-83+ coder

Joined: 18 Mar 2005 Posts: 1487 Location: Quebec (Canada)
|
Posted: 18 Apr 2012 09:55:44 pm Post subject: |
|
|
I know this probably won't answer your question, but is this program mainly for programming learning purposes? Because otherwise, you could save yourself a lot of work by downloading one of the 151 quadratic solvers (one of which features grayscale graphics using DCS7 or xLIB) already available at http://www.ticalc.org/pub/83plus/basic/math/quadratic/ _________________ Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)
Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter |
|
| Back to top |
|
|
Spenceboy98

Super-Expert

Joined: 06 Jan 2012 Posts: 826 Location: In the TARDIS
|
Posted: 18 Apr 2012 10:06:40 pm Post subject: |
|
|
| I want to make my own. It's for my Equation program. |
|
| Back to top |
|
|
Aes_Sedia5

Minor Calculator Deity

Joined: 01 Sep 2011 Posts: 1002 Location: Where Nightmares end and Dreams begin
|
Posted: 18 Apr 2012 10:07:39 pm Post subject: |
|
|
I dont know about spence, but I find that I like to make my own programs, and constantly improve until they are the fastest possible, and then the smallest possible while maintaining speed. _________________

 |
|
| Back to top |
|
|
|
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
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.026542 seconds.
|