Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default A quick java script for you all to use for the purpose of addition!

    Hey guys I'm just starting to get into the professional Java scene and I wrote this quick java script for you to all use when you need to do addition !

    PHP Code:
    $numberOne 1;
    $numberTwo 2;

    class 
    Addition
    {
        function 
    __construct()
        {
            
    $true true;
            
    $false false;
            
            
    // make REALLy sure our variables are correct!!!!!
            
    for( $i 0$i 200$i++ ) {
                if( 
    $true !== true ) {
                    exit( 
    'OH NO' );
                }
                if( 
    $false !== false ) {
                    exit( 
    'OH NO' );
                }
            }
        }
        
        function 
    addTwoNumbersTogetherButMakeSureTheyAreNotAnArrayFirst$numberOne$numberTwo )
        {
            
            
    $numberOneCheck = new ArrayBuilder();
            
    $numberTwoCheck = new ArrayBuilder();
            
            if( 
    $numberOneCheck->hiFunctionPleaseMakeSureThisIsAnIntegerAndNotAnArrayWeWouldntWantAnyAccidentsNowWouldWe$numberOne ) === 'NO IT IS NOT AN INTEGER' )
            { exit( 
    'AAAAAAAARGH IT IS NOT A NUMBER' ); }
            
            if( 
    $numberTwoCheck->hiFunctionPleaseMakeSureThisIsAnIntegerAndNotAnArrayWeWouldntWantAnyAccidentsNowWouldWe$numberTwo ) === 'NO IT IS NOT AN INTEGER' )
            { exit( 
    'AAAAAAAARGH IT IS NOT A NUMBER' ); }
            
            
    $numberOne = (int)$numberOne;
            
    $numberTwo = (int)$numberTwo;
            
            
    $newResult $numberOne $numberTwo;
            
    $newResult = (int)$newResult;

            if( ((int)
    $newResult - ((int)$numberOne + (int)$numberTwo)) === (int)) {
                return (string)
    $newResult;
            }
        }
    }

    class 
    ArrayBuilder
    {
        function 
    __construct()
        {
            
    $true true;
            
    $false false;
            
            
    // make REALLy sure our variables are correct!!!!!
            
    for( $i 0$i 200$i++ ) {
                if( 
    $true !== true ) {
                    exit( 
    'OH NO' );
                }
                if( 
    $false !== false ) {
                    exit( 
    'OH NO' );
                }
            }
        }
        
        function 
    parseArray$incoming )
        {
            if( 
    $this->makeReallySureTheThingComingInIsActuallyAnArray$incoming ) !== true ) {
                exit( 
    'OH NO IT\'S NOT REALLY AN ARRAY :(' );
            }
            
            
    // ok let's just make sure it isn't really trying to hdie
            
    if( $this->makeReallySureTheThingComingInIsActuallyAnArray$incoming ) !== true ) {
                exit( 
    'haha you thought you could catch me out you cannot i have found out you are not an array mr. not array!!!' );
            }
            
            
    $count count$incoming );
            
    $count = ($count + ($count $count)) + 1// ok we have added 1.
            
            
    return reset$incoming );
        }
        
        function 
    hiFunctionPleaseMakeSureThisIsAnIntegerAndNotAnArrayWeWouldntWantAnyAccidentsNowWouldWe$incoming )
        {
            if (
    is_array($incoming)) return "NO IT IS NOT AN INTEGER"
            if (
    is_bool($incoming)) return "NO IT IS NOT AN INTEGER"
            if (
    is_callable($incoming)) return "NO IT IS NOT AN INTEGER"
            if (
    is_float($incoming)) return "NO IT IS NOT AN INTEGER"
            if (
    is_int($incoming)) return "YES IT IS AN INTEGER"
            if (
    is_null($incoming)) return "NO IT IS NOT AN INTEGER"
            if (
    is_numeric($incoming)) return "NO IT IS NOT AN INTEGER"
            if (
    is_object($incoming)) return "NO IT IS NOT AN INTEGER"
            if (
    is_resource($incoming)) return "NO IT IS NOT AN INTEGER"
            if (
    is_string($incoming)) return "NO IT IS NOT AN INTEGER";

            exit( 
    'I DON\'T KNOW WHAT IT IS' );
        }
        
        function 
    makeReallySureTheThingComingInIsActuallyAnArray$incoming )
        {
            for( 
    $i 0$i 200$i++ ) {
                if( 
    is_array$incoming ) === true ) {
                    
    // Hmm it might be! let's make sure!
                    
    if( is_bool$incoming ) === false ) {
                        if( 
    is_callable$incoming ) === false ) {
                            if( 
    is_double$incoming ) === false ) {
                                if( 
    is_float$incoming ) === false ) {
                                    if( 
    is_int$incoming ) === false ) {
                                        if( 
    is_integer$incoming ) === false ) {
                                            if( 
    is_long$incoming ) === false ) {
                                                if( 
    is_null$incoming ) === false ) {
                                                    if( 
    is_numeric$incoming ) === false ) {
                                                        if( 
    is_object$incoming ) === false ) {
                                                            if( 
    is_real$incoming ) === false ) {
                                                                if( 
    is_resource$incoming ) === false ) {
                                                                    if( 
    is_scalar$incoming ) === false ) {
                                                                        if( 
    is_string$incoming ) === false ) {
                                                                            
    // ok we cool
                                                                        
    } else { exit( 'OH NO' ); }
                                                                    } else { exit( 
    'OH NO' ); }
                                                                } else { exit( 
    'OH NO' ); }
                                                            } else { exit( 
    'OH NO' ); }
                                                        } else { exit( 
    'OH NO' ); }
                                                    } else { exit( 
    'OH NO' ); }
                                                } else { exit( 
    'OH NO' ); }
                                            } else { exit( 
    'OH NO' ); }
                                        } else { exit( 
    'OH NO' ); }
                                    } else { exit( 
    'OH NO' ); }
                                } else { exit( 
    'OH NO' ); }
                            } else { exit( 
    'OH NO' ); }
                        } else { exit( 
    'OH NO' ); }
                    } else { exit( 
    'OH NO' ); }
                } else { exit( 
    'OH NO' ); }
            }
            
            return 
    true;
        }
    }

    $num] = new ArrayBuilder();
    $num] = new ArrayBuilder();

    $theNumber] = $num]->parseArray( array( 
        
    $numberOne
    ) );
    $theNumber] = $num]->parseArray( array( 
        
    $numberTwo
    ) );

    $addition = new Addition();

    $addition->addTwoNumbersTogetherButMakeSureTheyAreNotAnArrayFirst( (int)(integer)$theNumber[1], (int)(integer)$theNumber[2] );

    // oops i frogt to assign it a value!
    $newAddition = new Addition();
    $theEndValue $newAddition->addTwoNumbersTogetherButMakeSureTheyAreNotAnArrayFirst( (int)(integer)$theNumber[1], (int)(integer)$theNumber[2] );


    echo 
    $theEndValue ' IS THE NUMBER YOU WANTED TO FIND BY ADDITION';

    exit(01189998819991197253); 
    moderator alert Edited by HotelUser (Forum Super Moderator): Thread moved from "Technology Discussion".
    Last edited by HotelUser; 08-02-2011 at 12:54 PM.


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

  2. #2
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    That's PHP... PHP... not Java.

  3. #3
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    Quote Originally Posted by Dentafrice View Post
    That's PHP... PHP... not Java.
    i AM soary but i know javer i have done it for at least 6 years i know how to make java codes thanks!


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

  4. #4
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Mhmmm.. where's exit come from then?

  5. #5
    Join Date
    Jul 2004
    Location
    California
    Posts
    8,725
    Tokens
    3,989
    Habbo
    HotelUser

    Latest Awards:

    Default

    Quote Originally Posted by Agnostic Bear View Post
    Hey guys I'm just starting to get into the professional Java scene and I wrote this quick java script for you to all use when you need to do addition !

    PHP Code:
    $numberOne 1;
    $numberTwo 2;

    class 
    Addition
    {
        function 
    __construct()
        {
            
    $true true;
            
    $false false;
            
            
    // make REALLy sure our variables are correct!!!!!
            
    for( $i 0$i 200$i++ ) {
                if( 
    $true !== true ) {
                    exit( 
    'OH NO' );
                }
                if( 
    $false !== false ) {
                    exit( 
    'OH NO' );
                }
            }
        }
        
        function 
    addTwoNumbersTogetherButMakeSureTheyAreNotAnArrayFirst$numberOne$numberTwo )
        {
            
            
    $numberOneCheck = new ArrayBuilder();
            
    $numberTwoCheck = new ArrayBuilder();
            
            if( 
    $numberOneCheck->hiFunctionPleaseMakeSureThisIsAnIntegerAndNotAnArrayWeWouldntWantAnyAccidentsNowWouldWe$numberOne ) === 'NO IT IS NOT AN INTEGER' )
            { exit( 
    'AAAAAAAARGH IT IS NOT A NUMBER' ); }
            
            if( 
    $numberTwoCheck->hiFunctionPleaseMakeSureThisIsAnIntegerAndNotAnArrayWeWouldntWantAnyAccidentsNowWouldWe$numberTwo ) === 'NO IT IS NOT AN INTEGER' )
            { exit( 
    'AAAAAAAARGH IT IS NOT A NUMBER' ); }
            
            
    $numberOne = (int)$numberOne;
            
    $numberTwo = (int)$numberTwo;
            
            
    $newResult $numberOne $numberTwo;
            
    $newResult = (int)$newResult;

            if( ((int)
    $newResult - ((int)$numberOne + (int)$numberTwo)) === (int)) {
                return (string)
    $newResult;
            }
        }
    }

    class 
    ArrayBuilder
    {
        function 
    __construct()
        {
            
    $true true;
            
    $false false;
            
            
    // make REALLy sure our variables are correct!!!!!
            
    for( $i 0$i 200$i++ ) {
                if( 
    $true !== true ) {
                    exit( 
    'OH NO' );
                }
                if( 
    $false !== false ) {
                    exit( 
    'OH NO' );
                }
            }
        }
        
        function 
    parseArray$incoming )
        {
            if( 
    $this->makeReallySureTheThingComingInIsActuallyAnArray$incoming ) !== true ) {
                exit( 
    'OH NO IT\'S NOT REALLY AN ARRAY :(' );
            }
            
            
    // ok let's just make sure it isn't really trying to hdie
            
    if( $this->makeReallySureTheThingComingInIsActuallyAnArray$incoming ) !== true ) {
                exit( 
    'haha you thought you could catch me out you cannot i have found out you are not an array mr. not array!!!' );
            }
            
            
    $count count$incoming );
            
    $count = ($count + ($count $count)) + 1// ok we have added 1.
            
            
    return reset$incoming );
        }
        
        function 
    hiFunctionPleaseMakeSureThisIsAnIntegerAndNotAnArrayWeWouldntWantAnyAccidentsNowWouldWe$incoming )
        {
            if (
    is_array($incoming)) return "NO IT IS NOT AN INTEGER"
            if (
    is_bool($incoming)) return "NO IT IS NOT AN INTEGER"
            if (
    is_callable($incoming)) return "NO IT IS NOT AN INTEGER"
            if (
    is_float($incoming)) return "NO IT IS NOT AN INTEGER"
            if (
    is_int($incoming)) return "YES IT IS AN INTEGER"
            if (
    is_null($incoming)) return "NO IT IS NOT AN INTEGER"
            if (
    is_numeric($incoming)) return "NO IT IS NOT AN INTEGER"
            if (
    is_object($incoming)) return "NO IT IS NOT AN INTEGER"
            if (
    is_resource($incoming)) return "NO IT IS NOT AN INTEGER"
            if (
    is_string($incoming)) return "NO IT IS NOT AN INTEGER";

            exit( 
    'I DON\'T KNOW WHAT IT IS' );
        }
        
        function 
    makeReallySureTheThingComingInIsActuallyAnArray$incoming )
        {
            for( 
    $i 0$i 200$i++ ) {
                if( 
    is_array$incoming ) === true ) {
                    
    // Hmm it might be! let's make sure!
                    
    if( is_bool$incoming ) === false ) {
                        if( 
    is_callable$incoming ) === false ) {
                            if( 
    is_double$incoming ) === false ) {
                                if( 
    is_float$incoming ) === false ) {
                                    if( 
    is_int$incoming ) === false ) {
                                        if( 
    is_integer$incoming ) === false ) {
                                            if( 
    is_long$incoming ) === false ) {
                                                if( 
    is_null$incoming ) === false ) {
                                                    if( 
    is_numeric$incoming ) === false ) {
                                                        if( 
    is_object$incoming ) === false ) {
                                                            if( 
    is_real$incoming ) === false ) {
                                                                if( 
    is_resource$incoming ) === false ) {
                                                                    if( 
    is_scalar$incoming ) === false ) {
                                                                        if( 
    is_string$incoming ) === false ) {
                                                                            
    // ok we cool
                                                                        
    } else { exit( 'OH NO' ); }
                                                                    } else { exit( 
    'OH NO' ); }
                                                                } else { exit( 
    'OH NO' ); }
                                                            } else { exit( 
    'OH NO' ); }
                                                        } else { exit( 
    'OH NO' ); }
                                                    } else { exit( 
    'OH NO' ); }
                                                } else { exit( 
    'OH NO' ); }
                                            } else { exit( 
    'OH NO' ); }
                                        } else { exit( 
    'OH NO' ); }
                                    } else { exit( 
    'OH NO' ); }
                                } else { exit( 
    'OH NO' ); }
                            } else { exit( 
    'OH NO' ); }
                        } else { exit( 
    'OH NO' ); }
                    } else { exit( 
    'OH NO' ); }
                } else { exit( 
    'OH NO' ); }
            }
            
            return 
    true;
        }
    }

    $num] = new ArrayBuilder();
    $num] = new ArrayBuilder();

    $theNumber] = $num]->parseArray( array( 
        
    $numberOne
    ) );
    $theNumber] = $num]->parseArray( array( 
        
    $numberTwo
    ) );

    $addition = new Addition();

    $addition->addTwoNumbersTogetherButMakeSureTheyAreNotAnArrayFirst( (int)(integer)$theNumber[1], (int)(integer)$theNumber[2] );

    // oops i frogt to assign it a value!
    $newAddition = new Addition();
    $theEndValue $newAddition->addTwoNumbersTogetherButMakeSureTheyAreNotAnArrayFirst( (int)(integer)$theNumber[1], (int)(integer)$theNumber[2] );


    echo 
    $theEndValue ' IS THE NUMBER YOU WANTED TO FIND BY ADDITION';

    exit(01189998819991197253); 
    moderator alert Edited by HotelUser (Forum Super Moderator): Thread moved from "Technology Discussion".
    Quote Originally Posted by Dentafrice View Post
    That's PHP... PHP... not Java.
    Whole thing ruined
    I'm not crazy, ask my toaster.

  6. #6
    Join Date
    Dec 2006
    Location
    UK
    Posts
    6,444
    Tokens
    6,676

    Latest Awards:

    Default

    nice bit of java skills you've got there. Don't listen to the other guys

  7. #7
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Hahahaa, I think I get it now.. I've got the flu so I was knocked out on meds yesterday.. I'm guessing he's trying to say how much work it takes in Java to do oneee simple task.. gotya haha.

    Myy bad.

  8. #8
    Join Date
    Dec 2006
    Location
    UK
    Posts
    6,444
    Tokens
    6,676

    Latest Awards:

    Default

    grr now my trolling attempt sounds pointless

  9. #9
    Join Date
    Jun 2004
    Location
    Reading, Berkshire
    Posts
    2,260
    Tokens
    12,202
    Habbo
    :Jin:

    Latest Awards:

    Default

    Loving the new emergency telephone number.
    http://www.youtube.com/watch?v=RK4Xye7AErE
    Last edited by Jin; 14-02-2011 at 09:49 AM.


  10. #10
    Join Date
    May 2007
    Posts
    10,481
    Tokens
    3,140

    Latest Awards:

    Default

    Quote Originally Posted by Jin View Post
    Loving the new emergency telephone number.
    http://www.youtube.com/watch?v=RK4Xye7AErE
    118 999...

    How was that relevant? Am I not getting a joke or something?
    Chippiewill.


Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •