brainsnap 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f2f6ffe976b9d382664a65536b57bd75b09843d
4
- data.tar.gz: 6d0407a73b79f03c932d95085c5a271648d5d9cd
3
+ metadata.gz: 716006188e665e8dc077c9c129e95ebd1eb06c22
4
+ data.tar.gz: 89f96eb84d8849a932ba689543a2a0d321300d98
5
5
  SHA512:
6
- metadata.gz: 313a34a58b551712ea78441e7f29ed5747499e00dadb12482624e3fd2873d991e98f3a430d282972cccb0d090b3619f386ccdf83576ce5c3559cc3bd00446626
7
- data.tar.gz: 7c80b41de12a9701a1b33a36abef3835f8ba7e55aebd68b2bdac61b5d2811731a55aed3deacb65f0a9b949f945427dc08dc62d75c61b9c1873312cb14bc3a3e5
6
+ metadata.gz: 0f9617b41d362fbfa8c660469dd37c012b81a427c59ed8951a7a97bd33b9b2da08bdd448ba5b851a08aa26e931edb714708a818a47faf624dd9c0d8416f58a4f
7
+ data.tar.gz: 4bade9acd8bd26cc198a1f39336fffe8e87919db20f2eec482d201cc8c6c206d2816c182f7605b185ba88b7a9d8e5834dda0e0bd59004f149b39c4ffcb4d7bb5
@@ -1,3 +1,3 @@
1
1
  module Brainsnap
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -33,6 +33,7 @@ class HighScores
33
33
 
34
34
  def save
35
35
  players_as_hashes = @players.map(&:instance_variables)
36
+ players_as_hashes.sort! { |a, b| b[:score].to_i <=> a[:score].to_i }
36
37
  export(@file, players_as_hashes)
37
38
  end
38
39
 
@@ -62,6 +63,6 @@ class HighScores
62
63
 
63
64
  def sort_players
64
65
  @players = import(@file).map {|player| Player.new player}
65
- @players.sort { |a, b| b.score <=> a.score }
66
+ @players.sort! { |a, b| b.score.to_i <=> a.score.to_i }
66
67
  end
67
68
  end
data/lib/view.rb CHANGED
@@ -80,6 +80,7 @@ class View
80
80
  percent = 0
81
81
  (1..100).each{|x| sleep(0.01); print "Submitting your score...#{percent+=1}%\r"}
82
82
  puts
83
+ sleep 1
83
84
  puts "High Scores:"
84
85
  players.each { |player| puts "#{player.user_name}: #{player.score}" }
85
86
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brainsnap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Shine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-30 00:00:00.000000000 Z
11
+ date: 2014-12-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This is a simple trivia game for the command line.
14
14
  email: