Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:42 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.