DCSQuad Solver is a standard quadratic solver with the capability to solve for both real or imaginary roots of a quadratic equation. Its unique feature is that it is built using the Doors CS BASIC Libraries (DCSB Libs) for text input, mouse movement and clicking, and interface rendering. Doors CS 6.7 beta or higher required. As with all Doors CS GUI things, the [ALPHA] key will switch between letters and numbers/symbols when typing, [2nd] or [trace] moves between text editing and mouse movement, and [2nd] or [trace] clicks on buttons. Screenshots and code below for your edification.

Download
DCSQuad Solver v1.0



BASIC Code wrote:
::DCS
:"61B2341C382C4D86
:If 1337≠det([[42
:Then
:Disp "DOORS CS 6.7 OR","HIGHER REQUIRED","WWW.CEMETECH.NET
:Return:End
:Lbl A
:DelVar ADelVar BDelVar C
:E9→S:Ans→T
:Lbl B
:sum(10
:sum(7,1,"8850205088","Quadratic Solver
:sum(7,5,32
:sum(7,4,2,2,"A:
:sum(7,4,2,11,"B:
:sum(7,4,2,20,"C:
:sum(7,9,9,2,45,16,det(1,A
:sum(7,9,9,11,45,16,det(1,B
:sum(7,9,9,20,45,16,det(1,C
:If E9≠abs(S
:Then
:"S1: "+det(1,abs(S-iimag(S
:sum(7,4,2,37,0,Ans
:If 0≠imag(S
:sum(7,4,3+sum(0,Ans),37,0,"+"+det(1,abs(imag(S)))+"i
:End
:If E9≠abs(T:Then
:"S2: "+det(1,abs(T-iimag(T
:sum(7,4,2,45,0,Ans
:If 0≠imag(T
:sum(7,4,3+sum(0,Ans),45,"+"+det(1,abs(imag(T)))+"i
:End
:sum(7,7,60,2,"Solve
:sum(7,7,60,11,"Reset
:sum(7,7,60,20,"Quit
:sum(12,45,32,10→L6
:sum(10
:If 10=L6(4
:Goto A
:If 11=L6(4) or not(L6(4
:Then
:ClrHome:Real
:Disp "DCSQUAD SOLVER","BY Kerm MARTIAN
:Return:End:a+bi:Str0+"┼→Str0
:inString(Str0,"┼",2→X
:expr(sub(Str0,2,X-2→A
:inString(Str0,"┼",X+1→Y
:expr(sub(Str0,X+1,Y-X-1→B
:inString(Str0,"┼",Y+1→X
:expr(sub(Str0,Y+1,X-Y-1→C
:√(B²-4AC
:{‾B+Ans,B+Ans}/2A→L5
:L5(1→S
:L5(2→T
:Goto B
Generated by SourceCoder, © 2005-2010 Cemetech
I lol'd.
Lbls? Really? I thought they are EEEEEVVVVVVVILLLLLLLL


Yep, you have an end, so that means memory leak.... But scince the lables arnt used as a loop, im sure it will be fine Wink
Wow epic program, altough not as great as the grayscale quadratic solver Razz
qazz42 wrote:
Lbls? Really? I thought they are EEEEEVVVVVVVILLLLLLLL


Yep, you have an end, so that means memory leak.... But scince the lables arnt used as a loop, im sure it will be fine Wink
Correction, the labels aren't used in a loop or an IF:THEN statement.
Ah, Ok, Isee it, THATS why my program hada memory leaak, thanks Comic
qazz42 wrote:
Lbls? Really? I thought they are EEEEEVVVVVVVILLLLLLLL


Yep, you have an end, so that means memory leak.... But scince the lables arnt used as a loop, im sure it will be fine Wink
No, you're misunderstanding what causes memory leaks. There's nothing wrong with Lbls and Gotos when used sparingly and properly. The problem is specifically a Goto inside a While/End, a Repeat/End, a For/End, or an If/Then/Else/End. If/Goto is acceptable, though.

DJ: Thanks, I'll see what I can do to make it grayscale. Wink
Ah, I got it, It is just that this quote kinda made me fell otherwise


Quote:
Don't use stop, its bad coding style. Use 'Return' instead.

Lbls are evil, eventually learn to not use them, it is possible.

If your last line of a program is 'Stop', just remove it, the program will stop on its own.

Did I mention that Lbls are crap?
It's a good newbie rule of thumb, because if you don't use labels at all it's hard to use them improperly. Smile I agree that the best method to use the properly is learn to write programs without them, then learn one or two cases where they're OK, like restarting execution near the top of a program when you're positive you're not inside any control loops or conditional blocks.

qazz42 wrote:
Don't use stop, its bad coding style. Use 'Return' instead.
It's not only bad coding style, it breaks most shells (although not Doors CS).
Ah, ok, I think I got that


My entry had actuall like 2 lbls but I got rid of theme, I think you guys made me waaayyy to scared to use them, but that aside now, lets try not to go off-topic XD
qazz42 wrote:
Ah, ok, I think I got that


My entry had actuall like 2 lbls but I got rid of theme, I think you guys made me waaayyy to scared to use them, but that aside now, lets try not to go off-topic XD
It isn't _too_ offtopic, good coding style should be important in DCSBL programs. Smile Maybe I should even resurrect the BASIC Elite Apprentice/Member classifications. Razz

What other programs should I make to demo the DCSBLs? What programs have you guys made to try them out?
My wish: a grayscale, 3D, DCSB-enabled quadratic solver that outputs the result in hex.
Silver Shadow wrote:
My wish: a grayscale, 3D, DCSB-enabled quadratic solver that outputs the result in hex.
Haha, 3D, really? How would that work, exactly?
A 3D GUI, where you are Link and you have to jump on stones to input numbers.
Silver Shadow wrote:
A 3D GUI, where you are Link and you have to jump on stones to input numbers.
Actually, that's sounds like a ton of fun. Smile I could see it being easy to take a long time to type and mistype numbers, though. Very Happy
This is why it will have an awesome auto-correct function, which will automatically correct all your mistakes and even give suggestions based on the most common used numbers and the user's own input.
Silver Shadow wrote:
This is why it will have an awesome auto-correct function, which will automatically correct all your mistakes and even give suggestions based on the most common used numbers and the user's own input.
That sounds pretty nifty, is that going to be your contest entry? Very Happy
  
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
Page 1 of 1
» All times are UTC - 5 Hours
 
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

 

Advertisement