Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    May 2007
    Posts
    10,481
    Tokens
    3,140

    Latest Awards:

    Default Christmas Challenge: Day 9

    Today's Challenge is another coding one (Obviously!). You must create a web script (With only, HTML PHP, MySQL and Javascript) which counts down to December 25th 2011, 00:00:00. You may think, wow this is easy, and it is, however you are not being judged on speed, no, you are being judged on:

    - Quality of coding
    - Features of Script
    - Accuracy of time (If you take into account latency that will be very interesting)

    The best scripts will either be, Javascript auto updating, or PHP with GD libraries to make a dynamic image.

    Please do make an attempt even if you don't think you're very good, you might learn something!

    PRIZE: TWO months of Christmas VIP

    Note: This is not an Official Habbox Competition
    Last edited by Chippiewill; 09-12-2011 at 06:54 PM.
    Chippiewill.


  2. #2
    Join Date
    Jan 2010
    Location
    United Kingdom
    Posts
    846
    Tokens
    1,766
    Habbo
    triston220

    Latest Awards:

    Default

    These coding competitions are a great idea.


    Quote Originally Posted by Jaaaack! View Post
    See, however much I want this, my girlfriend uses my PC too much, and I would be killed.





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

    Latest Awards:

    Default

    If I receive no entry of this challenge I will run the months over onto something else.

    Also if people have no idea how to do this then:

    1324771200 - time() = Number of seconds until christmas day

    Divide this by 60, the remainder is your number of seconds
    Divide that by 60, the remainder is the number of minutes
    Divide that by 24 to find the number of days , the remainder is the number of hours

    Quote Originally Posted by triston220 View Post
    These coding competitions are a great idea.
    Thanks.
    Chippiewill.


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

    Latest Awards:

    Default

    Well, nobody took a bite unfortunately. I just chucked this together in about ten minutes:

    PHP Code:
    <?php
    $time 
    1324771200 time();

    $times $time 60;
    $time floor($time 60);

    $timem $time 60;
    $time floor($time 60);

    $timeh $time 24;
    $time floor($time 24);

    print(
    $time." Days, ".$timeh." Hours, ".$timem." Minutes, ".$times." Seconds.");
    ?>
    Which results in something like "11 Days, 8 Hours, 6 Minutes, 43 Seconds."

    I might still be willing to offer a prize for prettying it
    Last edited by Chippiewill; 13-12-2011 at 03:56 PM.
    Chippiewill.


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

    Latest Awards:

    Default

    Got bored and fixed some errors for when the time till christmas is negative and I made it so it fixes itself every news years day for the next year:

    PHP Code:
    <?php
    $christmas 
    mktime(0,0,0,12,25,date("Y")); // Finds the timestamp for Christmas at midnight of the current year (Hours,Minutes,Seconds,Months,Days,Year), date("Y") finds the current year

    $time $christmas time(); //Finds seconds between Christmas at midnight and the time now.

    if($time <0) {print("Merry Christmas");} // Prevents errors if it is beyond midnight

    else { // Adds an exception

    $times $time 60// Finds the number of seconds as a result of finding the remainder of dividing by 60
    $time floor($time 60); // Effectively removes those seconds from the total by dividing by 60 and then flooring

    $timem $time 60// Finds the number of minutes as a result of finding the remainder of dividing by 60
    $time floor($time 60); // Effectively removes those minutes from the total by dividing by 60 and then flooring

    $timeh $time 24// Finds the number of hours as a result of finding the remainder of dividing by 24
    $time floor($time 24); // The number of hours is the floored value of dividing the number of hours by 24

    print($time." Days, ".$timeh." Hours, ".$timem." Minutes, ".$times." Seconds.");

    }
    // The End
    ?>
    Chippiewill.


  6. #6
    Join Date
    Sep 2010
    Location
    Derbyshire
    Posts
    3,442
    Tokens
    683
    Habbo
    Zuth

    Latest Awards:

    Default


    RIP Grandad - Click here to see my Dads Subaru Impreza WRX STI in action!


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

    Latest Awards:

    Default

    You're certainly in the lead.. for now.
    Chippiewill.


  8. #8
    Join Date
    Sep 2010
    Location
    Derbyshire
    Posts
    3,442
    Tokens
    683
    Habbo
    Zuth

    Latest Awards:

    Default

    lol, watch [@]@Recursion[/@] come pown me

    RIP Grandad - Click here to see my Dads Subaru Impreza WRX STI in action!


  9. #9
    Join Date
    May 2005
    Location
    /etc/passwd
    Posts
    19,110
    Tokens
    1,139

    Latest Awards:

    Default

    Quote Originally Posted by Zuth View Post
    lol, watch [@]@Recursion[/@] come pown me
    I do Python, not PHP!
    Quote Originally Posted by Chippiewill View Post
    e-rebel forum moderator
    :8

  10. #10
    Join Date
    Sep 2010
    Location
    Derbyshire
    Posts
    3,442
    Tokens
    683
    Habbo
    Zuth

    Latest Awards:

    Default

    Quote Originally Posted by Recursion View Post
    I do Python, not PHP!
    No idea what that is, but fingers crossed

    RIP Grandad - Click here to see my Dads Subaru Impreza WRX STI in action!


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
  •