symbol-holic 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1809baa7793c5864918d9be0c7e16a7b18d231313dd570a6f6f39ade81f4a4e
4
- data.tar.gz: b53d340ae23411fd13a72d344ff0d9ef96a43305e50567f3c10d9c4acb653d77
3
+ metadata.gz: f49cbbf9f557602ef79549dc4e88e398294d3cbc97896c4207437df3025b6c38
4
+ data.tar.gz: ab22542668fa35a3401a1b90965be32117c13285066cf6b7e622e7002c679050
5
5
  SHA512:
6
- metadata.gz: 70c02b5a06746a12e3c99db627716ccf14fd0b55d663c973fb326edf88babbca9264d818b92d512be9ef85c1483eb5bf27ccd1524407858f9e61b7349a3420c1
7
- data.tar.gz: 602d2948612e955a8cc990a0d1d9f8ff752db5cb8bb1b5e0c50105dc97a454ada91f9cd9d805f420611e541297774917d4e5172da5db61691a86d5752338104a
6
+ metadata.gz: 07d51f051aa590adeb154fca6832ec2fc9616214ea8eabe70755430b2e901bfa837bde0ae6ff2bf86ee9e8b0ce5a7ecea917a734983f74923789d12aa4dbfaea
7
+ data.tar.gz: 3711ae94d1bb95aeecbd66fa37b5617dc53b97cbe15156b4fec765b77bc1deb8425461721dda7fe137bf3e95160cabe7af16182bac40d32e3a4690f5f4339df7
@@ -20,7 +20,9 @@ class Menu
20
20
  { name: 'Exit', value: '5' }
21
21
  ]
22
22
  # TTY prompt with the menu choices, users can select one of these items
23
- TTY::Prompt.new.select('Welcome to Symbol-holic!', menu_choices)
23
+ TTY::Prompt.new.select('
24
+ █▀ █▄█ █▀▄▀█ █▄▄ █▀█ █░░ ▄▄ █░█ █▀█ █░░ █ █▀▀
25
+ ▄█ ░█░ █░▀░█ █▄█ █▄█ █▄▄ ░░ █▀█ █▄█ █▄▄ █ █▄▄', menu_choices)
24
26
  end
25
27
 
26
28
  # This is the loop which runs and displays the menu to the user
@@ -65,6 +67,7 @@ class Menu
65
67
  @scores = @typing_game.run_game
66
68
  # @scores eg {";"=>[1, 1, 51.413921326711545], ":"=>[1, 0, 79.55781654849564], "#"=>[2, 0, 164.6563074129133]}
67
69
  @typing_statistics.statistics(@scores)
70
+ @typing_statistics.write_statistics
68
71
  end
69
72
 
70
73
  # Method for running the targeted typing game
@@ -72,6 +75,7 @@ class Menu
72
75
  @typing_game = TypingGame.new
73
76
  @scores = @typing_game.targeted_game
74
77
  @typing_statistics.statistics(@scores)
78
+ @typing_statistics.write_statistics
75
79
  end
76
80
 
77
81
  # Menu option and TTY prompt for deleting all typing statistics
@@ -2,7 +2,7 @@ require 'json'
2
2
  require 'terminal-table'
3
3
  require 'tty-pie'
4
4
  require 'colorize'
5
- require 'colorized_string'
5
+ require 'byebug'
6
6
  require_relative 'typing_game'
7
7
  require_relative 'statistics_helper'
8
8
  class TypingStatistics
@@ -32,7 +32,7 @@ class TypingStatistics
32
32
  @averaged_statistics[key][4] = average_wpm(@averaged_statistics[key][3], @averaged_statistics[key][0])
33
33
  end
34
34
  # Write the statistics at the end of each game into the JSON file
35
- write_statistics(sort_averaged_statistics(@averaged_statistics))
35
+ sort_averaged_statistics(@averaged_statistics)
36
36
  end
37
37
 
38
38
  # Total counter method to assist with setting the key values
@@ -74,8 +74,8 @@ class TypingStatistics
74
74
  end
75
75
 
76
76
  # Write the averaged_statistics hash to the JSON file
77
- def write_statistics(averaged_statistics)
78
- File.write(file_path, JSON.pretty_generate(averaged_statistics))
77
+ def write_statistics
78
+ File.write(file_path, JSON.pretty_generate(@averaged_statistics))
79
79
  end
80
80
 
81
81
  # Make a pie chart for the hit and miss count
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: symbol-holic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rory Musinskas