Thread: ABC Theory
View Single Post
  #1  
Old 11-28-2006, 12:31 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
ABC Theory

I just made a simple workout for the ABC theory, example:

You have the formule: 2x + 3 = 0
You can work this out like.. -3 on both sides, so 2x = - 3
You do it all / 2, and you'll have x = - 1.5... but now
You've got this formule: -33.5x² + 1.5x + 4 = 0, how are we going to do this?
Fill in for;
a: -33.5
b: 1.5
c: 4

PHP Code:
function onCreated() {
  
= - 33.5;
  
1.5;
  
4;
  
/* Don't edit below here */
  
xr "";
  
= ( 2) - c;
  if ( 
NULL) {
    for ( try: { 
"-""+"}) {
      if ( try = 
"-")
        
xr = ( - - ( 0.5)) / ( a);
      else if ( try = 
"+")
        
xr @= " or " @ ( - + ( 0.5)) / ( a);
    }
  }
  else if ( 
NULL) {
    
xr = - / ( a);
  }
  else
    
xr "No solutions!";
  echo( 
"Result: " xr);

And as you see, the result will be (for 'x' in the formule);
Result: 0.368659933 or -0.323883813

You don't realy have anything that you can use it for in Graal, but whatever, wanted to work it out in a script
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote