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 $holdem()
Start:May 24th 2007
End:June 7th 2007
Results:

I have to say that this challenge wasn't quite such as success that I hoped for. There were very few participants compared to e.g. the $isdate challenge. Are the challenges I'm setting too difficult? Anyway, on to the results...

There was a total of 6 entries of which 3 were valid and 3 were invalid.

Winner! jaytea (492 bytes!)

alias + if ($3) inc %f $calc(18^($iif($pos(%e,$mid(%e,-1),5),5)+$2)*$1)
alias holdem {
  tokenize 32 $replace($1,T,B,10,T)
  %a = 0
  %b = $0
  while %b {
    %c = $(,$ $+ %b)
    dec %b
    %d = %b
    while %d {
      %e = $deltok($remove($1-,%c),%d,32)
      %f =
      var %2,%3,%g,%h,%i 1
      while $mid(23456789TJQKA,%i,1) {
        %j = $count(%e,$v1)
        inc %g %j
        + %i $token(%g $iif(%2,7,6) 8 12,%j,32) %j
        var % $+ %j %i,%h %h $+ %j
        inc %i
      }
      + %3 11 %2
      + $pos(%j $+ %h,11111) 9 1
      if $mid(%c,2) !isin S D C H || (%g != 5) %a =
      if (%f > %a) %a = %f
      dec %d
    }
  }
  return %a


Not quite so enigmatic as his last bit of code, but still beautiful.

Also, due to the lack of participants, I tried to be a bit forgiving when it came to juding the entries. Jaytea's entry has a few validation problems, as does urza's entry, but I didn't want to make these invalid. However, it was completely unacceptable for a script to not work at all (myndzi) and for the fundamental rules of poker to slip by them (NaquadaBomb)... as as for visionz entry, well, I was tempted to mark it invalid instantly. But I gave it a chance ;)

It will be quite a while before I set a new challenge. If you have any ideas for this challenge please private message garreh.

Winner:

  • jaytea    492 bytes!  

  • Top Entries
  •  Ag2X
  • 1085 bytes
  •  urza
  • 1176 bytes

    Invalid Entries
  •  visionz
  • 78 bytes* got lucky on a few
  •  myndzi
  • 748 bytes* /if: ambiguous format (line 11, script18.mrc)............ deary me.
  •  NaquadaBomb
  • 11923 bytes* 3C 5C 7C 4C 2C 7H 8H (5864) beats 6S 7D 8D 9D 4D 5D 6D (5863)

    Description:

    Texas Hold'em

    In this challenge you are asked to code an alias that will return what the score of a player's hand is.

    Card naming scheme



    AAce
    22
    33
    44
    55
    66
    77
    88
    99
    1010
    JJack
    QQueen
    KKing
    DDiamond
    HHeart
    SSpade
    CClub


    Specfications



    The alias will accept one parameter ($1) which should be exactly seven cards.

    Each card is seperated by a space and represented in the format:

    [card][suit]


    Parameter one ($1) is the only used parameter; all of the other parameters ($2-) should be ignored.

    Potential incorrect inputs may include (but are not limited to) the following:

  • Incorrect number of cards (not 7 cards)
  • Duplicate cards (pay attention to this one!)
  • Incorrect card formatting, e.g. 4DD instead of 4D


  • In each of these cases and any other erroneous inputs, the identifier should return $null. You will assume anything can be supplied as a parameter. All of the above conditions will be checked.

    Your alias must be case-insensitive, e.g. "4d" is the same as "4D".

    Scoring System



    In terms of the scoring system, it is up to you to come up with a scoring system. Whatever scoring system you use, you have to follow this simple rule; the higher the number, the higher the hand is rated, e.g. 500 could be three of a kind, 400 could be two pair.

    You are allowed to use decimals, or even negative values, just as long as it follows the above rule.

    Do not forget you need to factor in high cards and kickers. You should always have five cards factored into your score.

    Hands & Their Rank





    Example:


    $holdem(4C 4H 10D AC AS 4D 7C)
    $holdem(AH 10C 3H 4H 6S 2C 5D)
    $holdem(AS JS QS KS 4S 10S 2C)
    $holdem(8C 10C 9C 6C 7S 7C AD)
    $holdem(QH 2S 7D QC 5D QD QS)
    $holdem(KD 9D 7D 5D AS 2D JC)
    $holdem(8D 7C 6D JS QH 5S 4H)
    $holdem(KC QH QS 7C 4H QC 9D)
    $holdem(2D JS 10H 9D 8S JD 9H)
    $holdem(4S KC 9D 8S 4H KH QD)
    $holdem(KC QS 8D 5S 2D AS 3D)
    $holdem(Kd Ks Kh Kc As)
    $holdem(Kd Ks Kh Kc As 10s Kd)
    $holdem(K10 Kh 9s 10h 2s J9 7d)
    $holdem(K J Q 10 9 8 7)
    Hand
    Fours full of Aces
    Straight 2-6
    Royal Flush
    Straight flush 6-10
    Four of a kind, queens, 7 kicker
    Flush, diamods, king high
    Straight, 4-8
    Three of a kind, queens, King kicker
    Two pair, Jacks and Nines, 10 kicker
    Two pair, Kings and fours, Queen kicker
    Ace High
    $null
    $null
    $null
    $null



    * These examples do NOT specifically represent what the alias should return. They should only be used as a reference.


    External sources



    Rules:

  • Alias name must be 'holdem'
  • No dlls, coms, sockets or regular expressions
  • One submission per user.
  • Script must give correct results after consecutive runs.


  • Testing conditions:

  • Alias will be run on mIRC v6.21 and loaded into the remotes section.
  • Your code will be taken for EXACTLY as-is.
  • Alias will be run on a mIRC with no variables set - a clean mIRC.


  • Countcode:
    (this is a temporary replacement for countcode... JavaScript needs to be enabled.)