cootie_catcher 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: dc3c75017f5c6d61053846ef21b23890cfbb3dcd
4
+ data.tar.gz: e813e073f829ee0060aa9d875f91f1a8b0fbcb4e
5
+ SHA512:
6
+ metadata.gz: 41fc9f8b2c432d299ced0da608175abe68f1937fc08158577e9772941bbe3c288544789ab8ab98be4ba81586fab785d718262f61e92ff257d69271de6f861ee5
7
+ data.tar.gz: fb13a8ffd341db72ce58098de6fbf8fdfac980fd4bae71020242771c073a420c395271b7697b7d0a9097925c180584e7c7cbec7fc5451009c73a5197974e17c4
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'cootie_catcher'
@@ -0,0 +1,96 @@
1
+ class CootieCatcher
2
+
3
+ COLORS = ["RED", "GREEN", "PINK", "YELLOW", "ORANGE", "BLUE", "BLACK", "WHITE", "MAGENTA", "ROSE GOLD", "GREY", "SILVER"]
4
+
5
+ NUMBERS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
6
+
7
+ FORTUNES = [
8
+ "Do not mistake temptation for opportunity.",
9
+ "Never wear your best pants when you go to fight for freedom.",
10
+ "Your friends secretly agree that your head is too small for your body.",
11
+ "Accept that some days you're the pigeon and some days you're the statue.",
12
+ "Don't fry bacon in the nude.",
13
+ "When everything's coming your way, you're probably in the wrong lane.",
14
+ "Hearty laughter is a good way to jog internally without having to go outdoors.",
15
+ "Life will be happy, until the end when you'll pee yourself a lot.",
16
+ "A thrilling time is in your immediate future.",
17
+ "An alien of some sort will be appearing to you shortly!",
18
+ "You will find a thing and it will be important.",
19
+ "You are cleverly disguised as a responsible adult.",
20
+ "You will soon have an out of money exprience.",
21
+ "He who dies with most money, still dies.",
22
+ "Look before you leap. Or wear a parachute.",
23
+ "The end is near, mine as well have dessert.",
24
+ "Your pet is planning to eat you.",
25
+ "Don't trust your cat.",
26
+ "A lucrative career change awaits. Have you considered gangsta rap?",
27
+ ]
28
+
29
+ def play
30
+ color
31
+ if valid_color?
32
+ number
33
+ continue
34
+ else
35
+ print_bad_color_input_message
36
+ play
37
+ end
38
+ fortune
39
+ end
40
+
41
+ def continue
42
+ if valid_number?
43
+ second_number
44
+ else
45
+ print_bad_number_input_message
46
+ play
47
+ end
48
+ end
49
+
50
+ private
51
+ attr_reader :color_choice, :random_color, :random_number, :number_choice, :next_random_number, :second_number_choice
52
+
53
+ def color
54
+ puts "\nPick a color: "
55
+ @random_color = COLORS.sample(4)
56
+ puts random_color
57
+ @color_choice = gets.chomp.downcase
58
+ end
59
+
60
+ def valid_color?
61
+ @random_color.include?(@color_choice.upcase)
62
+ end
63
+
64
+ def print_bad_color_input_message
65
+ puts "Sorry, #{color_choice} is not a valid choice. Start over.\n"
66
+ end
67
+
68
+ def number
69
+ puts "\nPick a number: "
70
+ @random_number = NUMBERS.sample(4)
71
+ puts random_number
72
+ @number_choice = gets.chomp.to_i
73
+ end
74
+
75
+ def valid_number?
76
+ @random_number.include?(number_choice)
77
+ end
78
+
79
+ def print_bad_number_input_message
80
+ puts "Sorry, #{number_choice} is not a valid choice. Start over.\n"
81
+ end
82
+
83
+ def second_number
84
+ puts "\nPick a number: "
85
+ @next_random_number = NUMBERS.sample(4)
86
+ puts next_random_number
87
+ @second_number_choice = gets.chomp
88
+ end
89
+
90
+ def fortune
91
+ puts "\n"
92
+ puts FORTUNES.sample
93
+ end
94
+ end
95
+
96
+ CootieCatcher.new.play
metadata ADDED
@@ -0,0 +1,47 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cootie_catcher
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Julie Graceffa
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-09-06 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Relive your childhood with a good ol' game of paper oragami cootie catcher!
14
+ email:
15
+ - julie.graceffa@gmail.com
16
+ executables:
17
+ - cootie_catcher
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - bin/cootie_catcher
22
+ - lib/cootie_catcher.rb
23
+ homepage:
24
+ licenses:
25
+ - MIT
26
+ metadata: {}
27
+ post_install_message:
28
+ rdoc_options: []
29
+ require_paths:
30
+ - lib
31
+ required_ruby_version: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ required_rubygems_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ requirements: []
42
+ rubyforge_project:
43
+ rubygems_version: 2.6.6
44
+ signing_key:
45
+ specification_version: 4
46
+ summary: Cootie catcher fortune teller!
47
+ test_files: []