Author Topic: Quadratic Formula  (Read 9112 times)

0 Members and 1 Guest are viewing this topic.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Quadratic Formula
« Reply #30 on: November 01, 2010, 09:46:57 pm »
You left an extra parenthesis  :P

Code: [Select]
:ClrHome
:Pause "JFGI

Meh, let the user clear the screen:

Code: [Select]
:Pause "JFGI
« Last Edit: November 01, 2010, 09:47:57 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Quadratic Formula
« Reply #31 on: November 01, 2010, 09:50:04 pm »
why pause it anyway?
Code: [Select]
"JFGI


Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Quadratic Formula
« Reply #32 on: November 01, 2010, 10:10:41 pm »
And the official winner is...Runer112 with 54 bytes :P

Xeda had the first hyper optimization and then calcdude84se optimized it again. Runer112 then did an optimization that, in turn, actually wasn't since they resulted in the exact same size (since the new line accounts for the taking off two parentheses). Nemo then optimized it again and then Runer112 optimized again by taking out that last line.

If you want a winner the the latest one I would go with me with:

Code: [Select]
"GI
Who really needs the "Just F******" part? ;)
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Quadratic Formula
« Reply #33 on: November 02, 2010, 01:21:23 am »
Taken from Cemetech:

Code: [Select]
:Prompt A,B,C
:(-B+sqrt(B^2-4AC))/(2A
:Disp Ans, -B/A-Ans

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Quadratic Formula
« Reply #34 on: November 02, 2010, 01:42:26 am »
As long as we are keeping the list output (as a pause) and the
Code: [Select]
:ClrHome
:Disp "AX²+BX+C=0

Then here is a smaller version (by 1 byte):

:ClrHome
:Disp "AX²+BX+C=0
:Prompt A,B,C
:√(B²+4i²AC
:Pause .5A-1(-B+{Ans,-Ans


(The code box didn't allow the -1)

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Quadratic Formula
« Reply #35 on: November 02, 2010, 03:46:20 am »
As long as we are keeping the list output (as a pause) and the
Code: [Select]
:ClrHome
:Disp "AX²+BX+C=0

Then here is a smaller version (by 1 byte):

:ClrHome
:Disp "AX²+BX+C=0
:Prompt A,B,C
:√(B²+4i²AC
:Pause .5A-1(-B+{Ans,-Ans


(The code box didn't allow the -1)

It's smaller than who's by one byte?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Quadratic Formula
« Reply #36 on: November 03, 2010, 06:19:59 pm »
couldn't you use -4AC instead of i^2?  or am i missing something?

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Quadratic Formula
« Reply #37 on: November 03, 2010, 06:22:29 pm »
Having i2 forces the calculator to evaluate the expression as complex numbers, so the square root function won't throw an error and you can find imaginary roots.
« Last Edit: November 03, 2010, 06:23:08 pm by Runer112 »

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Quadratic Formula
« Reply #38 on: November 03, 2010, 06:23:33 pm »
couln't you set the mode to a+bi at the beginning?

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Quadratic Formula
« Reply #39 on: November 03, 2010, 06:25:21 pm »
Having i2 forces the calculator to evaluate the expression as complex numbers, so the square root function won't throw an error and you can find imaginary roots.

Plus it's two bytes smaller :P
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Quadratic Formula
« Reply #40 on: November 03, 2010, 06:25:24 pm »
couln't you set the mode to a+bi at the beginning?

this changes the mode setting, and adds just as many bytes as i2 anyway.


Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Quadratic Formula
« Reply #41 on: November 03, 2010, 06:31:11 pm »
kk, cool, you learn something new everyday.  ;)

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Quadratic Formula
« Reply #42 on: November 04, 2010, 03:00:08 am »
Sorry, in my program above, on my calculator I forgot the :ClrHome part. hehe...