power admin
+ Reply to Thread
Results 1 to 13 of 13

Thread: My Very First Program!

  1. #1
    Join Date
    Jan 2005
    Posts
    623

    Thumbs up My Very First Program!

    My Very First Output
    I would like to share with you the very first output I created in PHP. This is the easiest output you can create using PHP! New coders are **.*% successful when writing a program such as to function just as this one does. If you can not duplicate this output, please give up trying to code... You are completely hopeless. Confused? You should be! SORRY! You do not get any notes

    [php]
    <?
    $fill_array=array(
    "0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0",
    "0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0",
    "0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0"
    );

    $bits= array(
    "00","0*","*0","**"
    );

    $locations= array(
    "00" => array(
    "0*", "0*", "**", "*5", "20",
    "22", "2*", "*4", "**", "4*",
    "44", "46"
    ),
    "0*" => array(
    "00", "04", "06", "07", "08",
    "*2", "*6", "24", "25", "26",
    "28", "*2", "*6", "40", "42",
    "47"
    ),
    "*0" => array(
    "02", "05", "0*", "**", "*7",
    "2*", "2*", "*5", "*7", "4*",
    "45"
    ),
    "**" => array(
    "*0", "*4", "*8", "**", "27",
    "*0", "**", "**", "*8"
    )
    );

    while(isset($bits[0])){
    $random_num=rand(0,(count($bits)-*));
    $random_bit=$bits[$random_num];
    $random_location=rand(0,(count($locations[$random_bit])-*));
    $fill_array[(int)$locations[$random_bit][$random_location]]=$random_bit;
    unset($locations[$random_bit][$random_location]);
    $locations[$random_bit]=array_values($locations[$random_bit]);
    if(count($locations[$random_bit])==0){
    unset($locations[$random_bit]);
    $locations[$random_bit]=array_values($locations[$random_bit]);
    unset($bits[$random_num]);
    $bits=array_values($bits);
    }
    }

    $binary=implode("",$fill_array);
    $i=*;$bits=NULL;
    while(isset($binary[$i-*])){
    $bits .= $binary[$i-*];
    if($i%8==0){
    print_r(chr(bindec($bits)));
    $bits=NULL;
    }
    $i++;
    }
    ?>
    [/php]
    [url=http://www.syntax******.info/tools/services.php]Speed Up Windows XP[/url]
    [url=http://www.syntax******.info/tools/ip.php]Get An Ip Address[/url]
    [url=http://www.syntax******.info/tools/base_converter.php]Base Converter[/url]
    --------------------------------
    [URL=http://www.boninroad.com/syntax******/]Old Site[/URL]
    [URL=http://www.syntax******.info]Comming Soon[/URL]

  2. #2
    Join Date
    Aug 2007
    Posts
    122
    Wouldn't it have been easier to write:

    Code:
    print "Hello World!";
    ???

    Mr. Complicated!


    LOL


    I get many notices and warnings trying to run it using PHP v4.4.4


    I get:

    Code:
    Notice: Undefined index: *0 in D:\inetpub\wwwroot\TESTS\test.php on line 45
    
    Warning: array_values() [function.array-values]: The argument should be an array in D:\inetpub\wwwroot\TESTS\test.php on line 45
    
    Notice: Undefined index: 00 in D:\inetpub\wwwroot\TESTS\test.php on line 45
    
    Warning: array_values() [function.array-values]: The argument should be an array in D:\inetpub\wwwroot\TESTS\test.php on line 45
    
    Notice: Undefined index: ** in D:\inetpub\wwwroot\TESTS\test.php on line 45
    
    Warning: array_values() [function.array-values]: The argument should be an array in D:\inetpub\wwwroot\TESTS\test.php on line 45
    
    Notice: Undefined index: 0* in D:\inetpub\wwwroot\TESTS\test.php on line 45
    
    Warning: array_values() [function.array-values]: The argument should be an array in D:\inetpub\wwwroot\TESTS\test.php on line 45
    Last edited by JayT; 09-14-2007 at 01:04 AM.
    Oh to be free, so blissfully free, of the ravages of intelligence, there is no greater joy! - The Cweationist's Cweed

    All that is necessary for evil to triumph is a good PR firm.
    Very funny, Scotty. Now beam down my clothes!

  3. #3
    Join Date
    Jan 2005
    Posts
    623
    Update your PHP ...

    Notice its throwing those notices every time it completely empties an array. 00,0*,*0,**.

    The array is empty on PHP4 and cannot array_values() because there are no values in the array. PHP5 Accepts this and does not throw any warnings.
    [url=http://www.syntax******.info/tools/services.php]Speed Up Windows XP[/url]
    [url=http://www.syntax******.info/tools/ip.php]Get An Ip Address[/url]
    [url=http://www.syntax******.info/tools/base_converter.php]Base Converter[/url]
    --------------------------------
    [URL=http://www.boninroad.com/syntax******/]Old Site[/URL]
    [URL=http://www.syntax******.info]Comming Soon[/URL]

  4. #4
    Join Date
    Sep 2006
    Posts
    1,649
    SyntaX, you've been dabbling in code obfuscation way too long...
    "Workers of the world unite; you have nothing to lose but your chains." -Karl Marx

  5. #5
    Join Date
    Jan 2005
    Posts
    623
    Forget syntax******, I think I'll create a new account for SynTobfuscator!
    [url=http://www.syntax******.info/tools/services.php]Speed Up Windows XP[/url]
    [url=http://www.syntax******.info/tools/ip.php]Get An Ip Address[/url]
    [url=http://www.syntax******.info/tools/base_converter.php]Base Converter[/url]
    --------------------------------
    [URL=http://www.boninroad.com/syntax******/]Old Site[/URL]
    [URL=http://www.syntax******.info]Comming Soon[/URL]

  6. #6
    Join Date
    Sep 2005
    Posts
    2,050
    Don't you have a network admin job? Even as an unemployed adolescent, I wouldn't have enough time to write random code just to flex my coding skills.

    Nice code in any case.

  7. #7
    Join Date
    Jan 2005
    Posts
    623
    Its array awareness week. I'm just celebrating! So where is your array? Your not invited without one...

    Actually I was just learning the behaviors of different types of arrays, and how to move values around without completely destroying your array structure. Its harder than you think, but more useful than you think.
    [url=http://www.syntax******.info/tools/services.php]Speed Up Windows XP[/url]
    [url=http://www.syntax******.info/tools/ip.php]Get An Ip Address[/url]
    [url=http://www.syntax******.info/tools/base_converter.php]Base Converter[/url]
    --------------------------------
    [URL=http://www.boninroad.com/syntax******/]Old Site[/URL]
    [URL=http://www.syntax******.info]Comming Soon[/URL]

  8. #8
    Join Date
    Sep 2005
    Posts
    2,050
    So in other words, a slow day at work .

    Did you look up each ASCII character's decimal equivalent? I imagine that'd take quite some time, unless you have the entire ASCII table memorised. That would be a cool skill.
    Last edited by Ezekiel; 09-15-2007 at 07:42 AM.

  9. #9
    Join Date
    Jan 2005
    Posts
    623
    Work? Whats work? I dont ever work. Its all play.

    Well, I know that a space is "*2", "A" starts at 65 and "a" starts at *7... and I can add

    Oh yeah theres that explanation point... had to look that one up.
    [url=http://www.syntax******.info/tools/services.php]Speed Up Windows XP[/url]
    [url=http://www.syntax******.info/tools/ip.php]Get An Ip Address[/url]
    [url=http://www.syntax******.info/tools/base_converter.php]Base Converter[/url]
    --------------------------------
    [URL=http://www.boninroad.com/syntax******/]Old Site[/URL]
    [URL=http://www.syntax******.info]Comming Soon[/URL]

  10. #10
    Join Date
    Aug 2007
    Posts
    122

    Pedantic Fussbudget Me

    Quote Originally Posted by SyntaX****** View Post
    Work? Whats work? I dont ever work. Its all play.

    Well, I know that a space is "*2", "A" starts at 65 and "a" starts at *7... and I can add

    Oh yeah theres that explanation point... had to look that one up.


    WORK !???
    Obviously, the BBS obscenity filter is NOT working.
    LOL






    Perhaps these two native PHP functions could prove useful:


    Code:
    print ord("a"); // Print ASCII code of character "a"
    
    
    print chr(65);  // Print character corresponding to ASCII code 65

    A quick and simple ASCII table:

    Code:
    $out = "DEC\tCHR\tHEX<BR>\n";
    
    
    for ($i=*2;   $i < *2*;   $i++)
    {
    $out .= "$i\t" . chr($i) . "\t" . StrToUpper(DecHex($i)) . "<BR>\n";
    }
    
    print "<PRE>$out</PRE>";
    Last edited by JayT; 09-15-2007 at 03:52 PM.
    Oh to be free, so blissfully free, of the ravages of intelligence, there is no greater joy! - The Cweationist's Cweed

    All that is necessary for evil to triumph is a good PR firm.
    Very funny, Scotty. Now beam down my clothes!

  11. #11
    Join Date
    Jan 2005
    Posts
    623
    Yeah, I think we need to get that obscenity filter fixed!
    I only had to add the chr to the output of the binary bits:
    Code:
    print_r(chr(bindec($bits)));
    [url=http://www.syntax******.info/tools/services.php]Speed Up Windows XP[/url]
    [url=http://www.syntax******.info/tools/ip.php]Get An Ip Address[/url]
    [url=http://www.syntax******.info/tools/base_converter.php]Base Converter[/url]
    --------------------------------
    [URL=http://www.boninroad.com/syntax******/]Old Site[/URL]
    [URL=http://www.syntax******.info]Comming Soon[/URL]

  12. #12
    Join Date
    Sep 2005
    Posts
    2,050
    Quote Originally Posted by SyntaX****** View Post
    Well, I know that a space is "*2", "A" starts at 65 and "a" starts at *7... and I can add
    That'd be a somewhat awesome party-piece.

    You: "I can speak fluent ASCII."

    Someone else: "77 *0* ** **6 *** ***"
    Last edited by Ezekiel; 09-16-2007 at 05:42 AM.

  13. #13
    Join Date
    Sep 2005
    Posts
    2,050
    [URL="http://www.encyclopediadramatica.com/images/5/5*/Grammar_Nazi.gif"]I think you mean an exclamation point.[/URL]

+ Reply to Thread

Similar Threads

  1. C++ Program help
    By minaadel1994 in forum Programming
    Replies: 4
    Last Post: 11-12-2008, 03:40 PM
  2. Need a program
    By Goem in forum Programming
    Replies: 2
    Last Post: 04-08-2008, 10:43 PM
  3. Crack this program :D
    By gojuphace in forum Security & Encryption
    Replies: 3
    Last Post: 12-28-2007, 10:12 PM
  4. Program Too Big To Post
    By JayT in forum Programming
    Replies: 8
    Last Post: 09-25-2007, 04:29 AM
  5. Help me to take a keylogger on a program or something
    By Blindspit in forum Security & Encryption
    Replies: 7
    Last Post: 02-16-2006, 03:40 PM

Posting Permissions

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