<commit_before>require './pack'
require './card'

module Cribbage

  class Hand

    attr_reader :cards
    def initialize( pack )
      @cards = Array.new( 6 ) { pack.deal }
      @cards.sort_by! { |c| c.rank }
    end

    def discard( *discards )
      raise Exception.new( "There should be two discards" ) unless discards.size == 2

      discards.sort.reverse.each { |idx| @cards.slice!( idx ) }
    end

    def to_s
      @cards.map( &:short_name ).join ' '
    end

  end

  class GosuHand < Hand
    def initialize( pack )
      @cards = Array.new( 6 ) { pack.deal }
      @cards.sort_by! { |c| c.rank }
    end
  end
end
<commit_msg>Added set_positions() and draw() to GosuHand<commit_after>require './pack'
require './card'

module Cribbage

  class Hand

    attr_reader :cards
    def initialize( pack )
      @cards = Array.new( 6 ) { pack.deal }
      @cards.sort_by! { |c| c.rank }
    end

    def discard( *discards )
      raise Exception.new( "There should be two discards" ) unless discards.size == 2

      discards.sort.reverse.each { |idx| @cards.slice!( idx ) }
    end

    def to_s
      @cards.map( &:short_name ).join ' '
    end

  end

  class GosuHand < Hand

    def initialize( pack )
      @cards = Array.new( 6 ) { pack.deal }
      @cards.sort_by! { |c| c.rank }
    end

    def set_positions( left, top, gap )
      @cards.each do |c|
        c.set_position( left, top )
        left += gap
      end
    end

    def draw( orient )
      @cards.each { |c| c.draw( orient ) }
    end

  end
end

{'fraction_non_alphanumeric': 0.11855990068280571, 'fraction_numerical': 0.0037243947858473, 'mean_word_length': 1.8330404217926186, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7596750', 'n_tokens_mistral': 611, 'n_tokens_neox': 527, 'n_words': 152}