<commit_before>require_relative 'model/ship'
require_relative 'model/board'
require_relative 'model/bill'

def symbolify(input)
  input.to_sym
end

#turn position input into symbols
p1 = Board.new

p_carrier = Carrier.new(player = true)
p_battleship = Battleship.new(player = true)
p_cruiser = Cruiser.new(player = true)
p_submarine = Submarine.new(player = true)
p_destroyer = Destroyer.new(player = true)

p1.place_ship(p_carrier, :a2, 'v')
p1.place_ship(p_battleship, :g1, 'h')
p1.place_ship(p_cruiser, :a8, 'v')
p1.place_ship(p_submarine, :e5, 'h')
p1.place_ship(p_destroyer, :b4, 'h')



bill = Bill.new
b_carrier = Carrier.new
bill.place_ship(b_carrier, :a2, 'v')

until p1.game_over? || bill.game_over?

  puts "Bill's Board"
  puts bill
  puts '-' * 10
  puts "Your Board"
  puts p1

  print "pick a target: "
  input = gets.chomp
  bill.target(symbolify(input))


  winner = "You" if bill.game_over?

<commit_msg>simple setup to play a game<commit_after>require_relative 'model/ship'
require_relative 'model/board'
require_relative 'model/bill'

def symbolify(input)
  input.to_sym
end

p1 = Board.new

ships = [Carrier.new(player = true), Battleship.new(player = true), Cruiser.new(player = true), Submarine.new(player = true), Destroyer.new(player = true)]

until ships.empty?
  puts "Your Board"
  puts p1

  current_ship = ships.shift
  location = :placeholder
  alignment = nil

  until p1.place_ship(current_ship, location, alignment)
    puts "Please give a location and alignment to place your #{current_ship.class}"
    print "Location: "
    location = symbolify(gets.chomp)
    print "Alignment(h = horizonal, v = verticle): "
    alignment = gets.chomp
  end

end


bill = Bill.new
b_carrier = Carrier.new#(player = true) #uncomment to see Bill's ships
b_battleship = Battleship.new#(player = true) #uncomment to see Bill's ships
b_cruiser = Cruiser.new#(player = true) #uncomment to see Bill's ships
b_submarine = Submarine.new#(player = true) #uncomment to see Bill's ships
b_destroyer = Destroyer.new#(player = true) #uncomment to see Bill's ships
bill.place_ships([b_carrier, b_battleship, b_cruiser, b_submarine, b_destroyer])

until p1.game_over? || bill.game_over?

  puts "Bill's Board"
  puts bill
  puts '-' * 10
  puts "Your Board"
  puts p1

  print "pick a target: "
  input = gets.chomp
  bill.target(symbolify(input))


  winner = "You" if bill.game_over?


{'fraction_non_alphanumeric': 0.11993313832010029, 'fraction_numerical': 0.00961136648558295, 'mean_word_length': 4.567441860465117, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3887088', 'n_tokens_mistral': 919, 'n_tokens_neox': 892, 'n_words': 222}