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

Web Site

FRIENDS
Link to us!
PhotoShelf

PowWeb Hosting!

/join #mircscripts.org

Home | Scripting Challenge:

Challenge:Smallest $holdem()
Started: May 24th 2007
Ends: 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.)



     
    Challenge has ended. Submission form automatically closed
     
    Challenge Forum:

      Age:   Mode:   Sort By:    Create New Post


    Announcement -  * About Straights * - garreh (Jun 2, 2007 @ 8:50AM)   new!   
     

     Difficulty level - blue-elf (Aug 5, 2007 @ 10:10PM)   new!   

     RE: Difficulty level - zzattack (Aug 28, 2007 @ 7:57AM)   new!   
     

     Is there going to be a new challenge? - blink (Jul 4, 2007 @ 5:26AM)   new!   

     RE: Is there going to be a new challenge? - kerst (Jul 4, 2007 @ 9:50AM)   new!   
     

     comments :D - jaytea (Jun 15, 2007 @ 6:03PM)   new!   

     RE: comments :D - blink (Jun 16, 2007 @ 4:57PM)   new!   

     RE: comments :D - myndzi (Jun 17, 2007 @ 3:57PM)   new!   

     RE: comments :D - zzattack (Jun 26, 2007 @ 5:27AM)   new!   
     

     javascript - zzattack (Jun 17, 2007 @ 5:20PM)   new!   

     RE: javascript - garreh (Jun 18, 2007 @ 4:43AM)   new!   

     RE: javascript - hixxy (Jun 19, 2007 @ 7:03PM)   new!   

     RE: javascript - garreh (Jun 19, 2007 @ 7:58PM)   new!   
     

     accessibility ? - tropnul (Jun 15, 2007 @ 2:07PM)   new!   

     RE: accessibility ? - myndzi (Jun 17, 2007 @ 3:55PM)   new!   
     

     jaytea - garreh (Jun 15, 2007 @ 12:55PM)   new!   
     

     hi hi - jaytea (Jun 10, 2007 @ 11:44PM)   new!   

     RE: hi hi - m910q (Jun 11, 2007 @ 11:43AM)   new!   

     It's called a "challenge" for a reason... - myndzi (Jun 11, 2007 @ 5:21PM)   new!   
     

     Uhhh.... - myndzi (Jun 10, 2007 @ 12:51PM)   new!   

     RE: Uhhh.... - myndzi (Jun 10, 2007 @ 12:52PM)   new!   

     RE: Uhhh.... - garreh (Jun 10, 2007 @ 1:25PM)   new!   

     RE: Uhhh.... - myndzi (Jun 11, 2007 @ 5:18PM)   new!   

     RE: Uhhh.... - zzattack (Jun 10, 2007 @ 3:12PM)   new!   
     

     Invalid? - m910q (Jun 10, 2007 @ 4:54PM)   new!   

     RE: Invalid? - garreh (Jun 10, 2007 @ 5:02PM)   new!   

     RE: Invalid? - m910q (Jun 11, 2007 @ 11:34AM)   new!   
     

     $holdem(4C) return 0 - Ag2X (Jun 11, 2007 @ 7:22AM)   new!   

     RE: $holdem(4C) return 0 - garreh (Jun 11, 2007 @ 8:48AM)   new!   

     RE: $holdem(4C) return 0 - jaytea (Jun 11, 2007 @ 10:30AM)   new!   
     

     Important! - myndzi (Jun 7, 2007 @ 1:32PM)   new!   

     RE: Important! - garreh (Jun 7, 2007 @ 5:56PM)   new!   

     (Edit) Do you hate me now? - myndzi (Jun 7, 2007 @ 9:18PM)   new!   
     

     a test alias for your enjoyment! - jaytea (May 28, 2007 @ 12:50PM)   new!   

     RE: a test alias for your enjoyment! - myndzi (May 29, 2007 @ 5:57AM)   new!   

     RE: a test alias for your enjoyment! - m910q (May 29, 2007 @ 5:19PM)   new!   

     more tests - jaytea (Jun 7, 2007 @ 2:57AM)   new!   
     

     Scoring - Ag2X (Jun 4, 2007 @ 4:31PM)   new!   

     RE: Scoring - garreh (Jun 4, 2007 @ 5:45PM)   new!   

     RE: Scoring again :/ - Ag2X (Jun 5, 2007 @ 12:37PM)   new!   

     RE: Scoring again :/ - garreh (Jun 5, 2007 @ 1:54PM)   new!   
     

     One week left! Anyone want to disclose their code length? - NaquadaBomb (May 31, 2007 @ 7:59PM)   new!   

     RE: One week left! Anyone want to disclose their code length? - myndzi (Jun 1, 2007 @ 2:03AM)   new!   

     RE: One week left! Anyone want to disclose their code length? - garreh (Jun 1, 2007 @ 5:52AM)   new!   

     RE: One week left! Anyone want to disclose their code length? - NaquadaBomb (Jun 2, 2007 @ 10:06AM)   new!   

     RE: One week left! Anyone want to disclose their code length? - myndzi (Jun 3, 2007 @ 6:15PM)   new!   

     RE: One week left! Anyone want to disclose their code length? - tontito (Jun 4, 2007 @ 5:19PM)   new!   

     RE: One week left! Anyone want to disclose their code length? - zzattack (Jun 4, 2007 @ 5:35PM)   new!   

     RE: One week left! Anyone want to disclose their code length? - myndzi (Jun 4, 2007 @ 9:45PM)   new!   
     

     Just wondering - squirk (May 31, 2007 @ 4:00PM)   new!   

     RE: Just wondering - NaquadaBomb (May 31, 2007 @ 5:08PM)   new!   

     RE: Just wondering - NaquadaBomb (May 31, 2007 @ 7:50PM)   new!   

     RE: Just wondering - urza (Jun 1, 2007 @ 1:53AM)   new!   

     RE: Just wondering - zzattack (Jun 1, 2007 @ 1:27PM)   new!   

     RE: Just wondering - garreh (Jun 1, 2007 @ 2:04PM)   new!   

     RE: Just wondering - Ag2X (Jun 1, 2007 @ 4:16PM)   new!   

     RE: Just wondering - garreh (Jun 1, 2007 @ 4:45PM)   new!   

     RE: Just wondering - Ag2X (Jun 1, 2007 @ 4:51PM)   new!   

     RE: Just wondering - m910q (Jun 2, 2007 @ 4:19AM)   new!   

     RE: Just wondering - squirk (Jun 1, 2007 @ 7:07PM)   new!   

     RE: Just wondering - zzattack (Jun 2, 2007 @ 7:13AM)   new!   
     

     11202 unique 5-card poker (hold'em) hands - NaquadaBomb (May 25, 2007 @ 6:42PM)   new!   

     RE: 11202 unique 5-card poker (hold'em) hands - garreh (May 29, 2007 @ 12:31PM)   new!   

     RE: 11202 unique 5-card poker (hold'em) hands - garreh (May 29, 2007 @ 12:37PM)   new!   

     RE: 11202 unique 5-card poker (hold'em) hands - NaquadaBomb (May 29, 2007 @ 8:46PM)   new!   

     RE: 11202 unique 5-card poker (hold'em) hands - squirk (May 30, 2007 @ 2:38AM)   new!   

     RE: 11202 unique 5-card poker (hold'em) hands - NaquadaBomb (May 30, 2007 @ 9:02AM)   new!   

     More like 7462 - myndzi (May 29, 2007 @ 8:56PM)   new!   

     RE: More like 7462 - NaquadaBomb (May 30, 2007 @ 9:22AM)   new!   

     RE: More like 7462 - NaquadaBomb (May 30, 2007 @ 9:32AM)   new!   

     RE: More like 7462 - myndzi (May 30, 2007 @ 12:10PM)   new!   

     RE: More like 7462 - squirk (May 30, 2007 @ 1:01PM)   new!   

     RE: More like 7462 - NaquadaBomb (May 30, 2007 @ 1:56PM)   new!   

     RE: More like 7462 - squirk (May 30, 2007 @ 8:18PM)   new!   

     RE: More like 7462 - NaquadaBomb (May 30, 2007 @ 2:29PM)   new!   

     So, it's 7464, BUT! - NaquadaBomb (May 30, 2007 @ 2:11PM)   new!   

     RE: So, it's 7464, BUT! - myndzi (May 31, 2007 @ 1:41AM)   new!   

     RE: So, it's 7464, BUT! - garreh (May 31, 2007 @ 4:21AM)   new!   

     I was wrong, it is 7462... - NaquadaBomb (May 31, 2007 @ 11:44AM)   new!   
     

     2 pair scoring - urza (May 30, 2007 @ 11:15PM)   new!   

     RE: 2 pair scoring - myndzi (May 31, 2007 @ 1:43AM)   new!   

     RE: 2 pair scoring - jaytea (May 31, 2007 @ 5:18AM)   new!   

     RE: 2 pair scoring - urza (May 31, 2007 @ 9:33AM)   new!   
     

     Question - myndzi (May 29, 2007 @ 9:53AM)   new!   

     RE: Question - garreh (May 29, 2007 @ 12:10PM)   new!   

     RE: Question - myndzi (May 31, 2007 @ 2:11AM)   new!   

     RE: Question - jaytea (May 31, 2007 @ 7:16AM)   new!   
     

     sloooooooooooow code - jaytea (May 31, 2007 @ 5:24AM)   new!   
     

     Concerned - garreh (May 25, 2007 @ 10:56AM)   new!   

     RE: Concerned - myndzi (May 25, 2007 @ 8:43PM)   new!   

     RE: Concerned - garreh (May 26, 2007 @ 5:45AM)   new!   
     

     examples.. - Mazza (May 25, 2007 @ 11:57AM)   new!   

     RE: examples.. - Mazza (May 25, 2007 @ 1:08PM)   new!   

     RE: examples.. - tropnul (May 25, 2007 @ 5:59PM)   new!   
     

     Clarification of Hold 'em rules - Chessnut (May 25, 2007 @ 12:43PM)   new!   

     RE: Clarification of Hold 'em rules - garreh (May 25, 2007 @ 2:36PM)   new!   
     

     HERE'S SOME CODES: All error checks achieved, who wanna continue? - sprion (May 25, 2007 @ 5:46AM)   new!   

     RE: HERE'S SOME CODES: All error checks achieved, who wanna continue? - zzattack (May 25, 2007 @ 11:09AM)   new!   

     RE: HERE'S SOME CODES: All error checks achieved, who wanna continue? - sprion (May 25, 2007 @ 12:58PM)   new!   
     

     $holdem(Kd Ks Kh Kc As) why $null? - sprion (May 25, 2007 @ 2:48AM)   new!   

     RE: $holdem(Kd Ks Kh Kc As) why $null? - garreh (May 25, 2007 @ 3:38AM)   new!   
     

    Locked -  *MODERATION* New proposed goal for this challenge - garreh (May 23, 2007 @ 4:08PM)   new!   

     RE: New proposed goal for this challenge - myndzi (May 23, 2007 @ 4:21PM)   new!   

     RE: New proposed goal for this challenge - garreh (May 23, 2007 @ 5:00PM)   new!   

     RE: New proposed goal for this challenge - myndzi (May 24, 2007 @ 2:29AM)   new!   

     RE: New proposed goal for this challenge - garreh (May 24, 2007 @ 10:05AM)   new!   

     RE: New proposed goal for this challenge - myndzi (May 24, 2007 @ 12:39PM)   new!   
     

    Locked -  *MODERATION* Makin sum thread - myndzi (May 20, 2007 @ 8:36PM)   new!   

     Feedback - myndzi (May 21, 2007 @ 1:21AM)   new!   

     RE: Makin sum thread - garreh (May 21, 2007 @ 10:51AM)   new!   

     RE: Makin sum thread - myndzi (May 21, 2007 @ 3:58PM)   new!   

     RE: Makin sum thread - garreh (May 22, 2007 @ 2:57PM)   new!   

     RE: Makin sum thread - jaytea (May 22, 2007 @ 4:06PM)   new!   

     RE: Makin sum thread - myndzi (May 22, 2007 @ 7:18PM)   new!   

     RE: Makin sum thread - jaytea (May 22, 2007 @ 6:40AM)   new!   

     RE: Makin sum thread - garreh (May 22, 2007 @ 7:34AM)   new!   

     RE: Makin sum thread - m910q (May 22, 2007 @ 9:25AM)   new!   

     RE: Makin sum thread - myndzi (May 22, 2007 @ 7:19PM)   new!   

     RE: Makin sum thread - garreh (May 22, 2007 @ 7:40AM)   new!   

     RE: Makin sum thread - myndzi (May 22, 2007 @ 7:23PM)   new!   

     RE: Makin sum thread - garreh (May 22, 2007 @ 6:32PM)   new!   

     RE: Makin sum thread - myndzi (May 22, 2007 @ 7:30PM)   new!   

     Skip hand terms entirely? - myndzi (May 22, 2007 @ 7:37PM)   new!   

     RE: Skip hand terms entirely? - garreh (May 23, 2007 @ 12:03PM)   new!   

     RE: Makin sum thread - myndzi (May 22, 2007 @ 8:07PM)   new!   
     



    Create New Post

    You must be logged in to post messages.