forked from turingschool-examples/war_or_peace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwar_or_peace_runner.rb
76 lines (71 loc) · 2.56 KB
/
war_or_peace_runner.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
require './lib/card'
require './lib/deck'
require './lib/player'
require './lib/turn'
require 'pry'
card1 = Card.new(:diamond,'2', 2)
card2 = Card.new(:diamond,'3', 3)
card3 = Card.new(:diamond,'4', 4)
card4 = Card.new(:diamond,'5', 5)
card5 = Card.new(:diamond,'6', 6)
card6 = Card.new(:diamond,'7', 7)
card7 = Card.new(:diamond,'8', 8)
card8 = Card.new(:diamond,'9', 9)
card9 = Card.new(:diamond,'10', 10)
card10 = Card.new(:diamond,'Jack', 11)
card11 = Card.new(:diamond,'Queen', 12)
card12 = Card.new(:diamond,'King', 13)
card13 = Card.new(:diamond,'Ace', 14)
card14 = Card.new(:hearts, '2', 2)
card15 = Card.new(:hearts, '3', 3)
card16 = Card.new(:hearts, '4', 4)
card17 = Card.new(:hearts, '5', 5)
card18 = Card.new(:hearts, '6', 6)
card19 = Card.new(:hearts, '7', 7)
card20 = Card.new(:hearts, '8', 8)
card21 = Card.new(:hearts, '9', 9)
card22 = Card.new(:hearts, '10', 10)
card23 = Card.new(:hearts, 'Jack', 11)
card24 = Card.new(:hearts, 'Queen', 12)
card25 = Card.new(:hearts, 'King', 13)
card26 = Card.new(:hearts, 'Ace', 14)
card27 = Card.new(:spade, '2', 2)
card28 = Card.new(:spade, '3', 3)
card29 = Card.new(:spade, '4', 4)
card30 = Card.new(:spade, '5', 5)
card31 = Card.new(:spade, '6', 6)
card32 = Card.new(:spade, '7', 7)
card33 = Card.new(:spade, '8', 8)
card34 = Card.new(:spade, '9', 9)
card35 = Card.new(:spade, '10', 10)
card36 = Card.new(:spade, 'Jack', 11)
card37 = Card.new(:spade, 'Queen', 12)
card38 = Card.new(:spade, 'King', 13)
card39 = Card.new(:spade, 'Ace', 14)
card40 = Card.new(:club, '2', 2)
card41 = Card.new(:club, '3', 3)
card42 = Card.new(:club, '4', 4)
card43 = Card.new(:club, '5', 5)
card44 = Card.new(:club, '6', 6)
card45 = Card.new(:club, '7', 7)
card46 = Card.new(:club, '8', 8)
card47 = Card.new(:club, '9', 9)
card48 = Card.new(:club, '10', 10)
card49 = Card.new(:club, 'Jack', 11)
card50 = Card.new(:club, 'Queen', 12)
card51 = Card.new(:club, 'King', 13)
card52 = Card.new(:club, 'Ace', 14)
cards = [card1, card2, card3, card4, card5, card6, card7, card8, card9, card10,
card11, card12, card13, card14, card15, card16, card17, card18, card19, card20,
card21, card22, card23, card24, card25, card26, card27, card28, card29, card30,
card31, card32, card33, card34, card35, card36, card37, card38, card39, card40,
card41, card42, card43, card44, card45, card46, card47, card48, card49, card50,
card51, card52]
shuffled_cards = cards.shuffle!
#binding.pry
player1_cards = shuffled_cards[0..25]
player2_cards = shuffled_cards[26..51]
deck1 = Deck.new(player1_cards)
deck2 = Deck.new(player2_cards)
player1 = Player.new('Megan', deck1)
player2 = Player.new('Aurora', deck2)