MeChallenge 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/History.txt +8 -0
  2. data/lib/me_challenge.rb +19 -2
  3. metadata +1 -1
@@ -1,3 +1,11 @@
1
+ === 1.0.1 / 2008-12-18
2
+
3
+ * 1 Fixes
4
+
5
+ * Fixed Usage
6
+ * Adding documentation
7
+
8
+
1
9
  === 1.0.0 / 2008-12-18
2
10
 
3
11
  * 1 First Cut
@@ -3,10 +3,27 @@ $:.unshift File.join(File.dirname(__FILE__),'..','lib')
3
3
  require 'middle_earth_challenge_simulator'
4
4
 
5
5
  class MeChallenge
6
- VERSION = '1.0.0'
6
+ VERSION = '1.0.1'
7
7
 
8
8
  def self.run(args)
9
- MiddleEarthChallengeSimulator.run(args)
9
+ unless args.size == 5
10
+ puts "\nUSAGE:\n\tme_challenge rank1 health1 rank2 health2 rounds\n"
11
+ puts "EXAMPLE:\n\tme_challenge 50 100 30 100 10000"
12
+ return -1
13
+ end
14
+
15
+ c1 = Character.new("Character #1", args.shift.to_i, args.shift.to_i)
16
+ c2 = Character.new("Character #2", args.shift.to_i, args.shift.to_i)
17
+ rounds = args.shift.to_i
18
+
19
+ puts "Simulating #{rounds} rounds of combat between #{c1} and #{c2}\n"
20
+
21
+ mec = MiddleEarthChallengeSimulator.new(c1, c2, rounds)
22
+ mec.simulate
23
+
24
+ puts "#{mec.character1} won #{mec.character1_wins}"
25
+ puts "#{mec.character2} won #{mec.character2_wins}"
26
+
10
27
  end
11
28
  end
12
29
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: MeChallenge
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chesley Coughlin