Please Disable Ad-Block To View This Website.

If you block ads, this site can not survive!

Ads are very minimal for registered users. If you don't have an account please register now!

DOWNLOAD
 Full Scripts
 Addons
 Snippets
 DLLs
 MTS Themes
 Tutorials
 Misc.
 File Queue
 Download mIRC
INTERACT
 Screenshots
 Challenge
 Top Downloads
 Submit Form
 Forums

SEARCH
Site Search

FRIENDS
Link to us!
PhotoShelf

Top Challenge Entrants

  # User Points
  1 jaytea 587
  2 [Znork] 303
  3 urza 297
  4 Ag2X 288
  5 dr_Eamer 255
  6 Albie 199
  7 Chessnut 197
  8 A Noniem 194
  9 zzattack 186
  10 Kol 185
  11 m910q 168
  12 Sephiroth 115
  13 Auron956 114
  14 patje 114
  15 chid 110
  16 Ohad2121 92
  17 SkorpSSS 87
  18 DixrouE 84
  19 Suchorski 83
  20 ^Vampire^ 74
Challenge:Smallest $isdate()
Start:April 4th 2007
End:April 14th 2007
Description:

Hey guys. I'm sorry there has not been a challenge for a long time but I've been very busy. But anyway, here is the new challenge! :D

In this challenge you are asked to code an $isdate() alias that will return if a particular date is valid or not (taking into consideration leap years).

You will assume that the format will always be dd/mm/yyyy - however you may accept 1 instead of 01 in the date and month, but not 07 instead of 2007 in the year. In other words, since in 0008 there is only 1 significant figure, that should be taken. Checking of this length is unnecessary. If there are more than 2 digits for d, but they are insignificant - ignore them.

Note: this alias will be based on the Gregorian calendar. Dates will be tested all the back to 1/1/1 (01/01/0001) and to the future 31/12/9999. Checking to see if the date is within this range is unnecessary.

Example:


$isdate(a/a/a) = 0
$isdate(/12/2007) = 0
$isdate(0.1/5/2007) = 0
$isdate(30.1/01/1800) = 0
$isdate(.30/9/1500) = 0
$isdate(01/01/2007) = 1
$isdate(1/1/2007) = 1
$isdate(30/2/2000) = 0
$isdate(29/2/2000) = 1
$isdate(29/2/2001) = 0
$isdate(31/04/2010) = 0
$isdate(29/02/1700) = 0
$isdate(29/02/1600) = 1


Rules:

  • Alias name must be 'isdate'
  • Alias MUST return 0 if date is invalid or 1 if its valid.
  • No dlls, coms, sockets, regular expressions, $ctime $asctime, or $duration
  • One submission per user.
  • Your code will be taken for EXACTLY as submitted. Nothing will be changed in your submitted code - even if a subtle mistake is found.
  • Alias will be run on mIRC v6.21.
  • Script must give correct results after consecutive runs.
  • File will be loaded into the remotes section.
  • File we will be using to count the code: countcode.php
  • Code which exploits countcode will be rejected.
  • Alias will be run on a mIRC with no variables set - a clean mIRC.

    Entries will be judged on code size and whether they return the correct result (1 for valid date 0 for invalid).

    Feel free to ask any questions in the forum below.

    Good luck!