codebreakergem 0.1.5 → 0.1.6

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: 2e9c327984befd015e4cec054aff67ce2029ab3daaec0edf871c0c0e762c896c
4
- data.tar.gz: d1578f083dbe6c1a0b43642d2a5e20244594fd05a0373920561a6e08e13ea90f
3
+ metadata.gz: 4037f592f943f162e0d39abbfabe74e5ba3e7a79019e4dfbd875601cb6310293
4
+ data.tar.gz: 671252a913e1d5a691dd0ecda6c374f611a6d496a60c19f611b7e3f00e7a544c
5
5
  SHA512:
6
- metadata.gz: bd84bb3416395b7ec73326fcf66402374b4ac20eb743394b980552a4965750f7373c6d24f9aeeff62b40e392fcb07261e7bbe721d17b1e2e2b3330be7f77c777
7
- data.tar.gz: 851e28b9b47f99c24470f194603de61017017d639e7064e6ec37704507ccc87a1a8b6b4784a6b4bc9744c2e2772379e3b51e1bf937e6148d6fdfd6bc843ddcdf
6
+ metadata.gz: f690c6ae82685c759cd505675937d69738e3caa7fe4367fb748488dd906d3ce131bb8de4af73629c2d7fcf0e6b47110a21e386a9aad91f512f9d46659ef78090
7
+ data.tar.gz: af5513cf119e5acf09df2b4f7a6601e84fae9a8d66111dc74f336a39a5abe4dfc8323ca0d23c255cf2621798cc3c56e6ad33a1adf1fd6f5c7dfb4682c9f457de
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Codebreakergem
4
- VERSION = '0.1.5'
4
+ VERSION = '0.1.6'
5
5
  end
@@ -1,14 +1,7 @@
1
1
  en:
2
- class_error: 'Wrong type of variable'
3
2
  length_error: 'Length of the string is not in allowed range'
4
3
  no_hints: 'You have no more hints'
5
- hello_message: 'Hello player! Welcome to codebreaker'
6
4
  stats_header: "Rating Name Difficulty Attempts Total Attempts Used Hints Total Hints Used\n"
7
- menu: "Chose action:\n
8
- 1) Start\n
9
- 2) Rules\n
10
- 3) Stats\n
11
- 4) Exit\n"
12
5
  victory_message: 'Congratulations!!! YOU WON!!!'
13
6
  out_of_attempts: 'Unfortunately you have no more attempts'
14
7
  rules: " ____________________________________________________________________________________________\n
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codebreakergem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sasha
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-25 00:00:00.000000000 Z
11
+ date: 2019-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -74,7 +74,6 @@ files:
74
74
  - bin/console
75
75
  - bin/setup
76
76
  - codebreakergem.gemspec
77
- - datadata.yml
78
77
  - lib/classes/difficulty.rb
79
78
  - lib/classes/file_worker.rb
80
79
  - lib/classes/statistic.rb
@@ -86,7 +85,6 @@ files:
86
85
  - lib/locales/en.yml
87
86
  - lib/locales/ru.yml
88
87
  - lib/modules/check_module.rb
89
- - main.rb
90
88
  homepage: https://github.com/SashaZhuravskiy/CodebreakerGemRepo/
91
89
  licenses:
92
90
  - MIT
@@ -1 +0,0 @@
1
- --- Hello world
data/main.rb DELETED
@@ -1,76 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require './lib/codebreakergem.rb'
4
- include Codebreakergem
5
-
6
- def hello_message
7
- puts 'Hello'
8
- end
9
-
10
- def menu
11
- puts "Chose action:\n 1) Start\n 2) Rules\n 3) Stats\n 4) Exit\n"
12
- end
13
-
14
- def goodbye_message
15
- puts "Thank you for playing\nSee you next time"
16
- end
17
-
18
- def play_game
19
- user = nil
20
- user_input = ''
21
- puts "Input player's name:"
22
-
23
- loop do
24
- user = User.new(gets.chomp)
25
- break if user.validate?
26
- end
27
- game = Game.new(user)
28
-
29
- difficulties = Game::DIFFICULTIES.map(&:name)
30
-
31
- loop do
32
- puts "Chose difficulty"
33
- difficulties.each {|key| puts " -#{key}"}
34
- user_input = gets.chomp
35
- break if difficulties.include? user_input
36
- puts "Input one of proposed options"
37
- end
38
- game.difficulty = Game::DIFFICULTIES.find{|item| item.name == user_input}.dup
39
-
40
-
41
- while game.difficulty.attempts.positive? do
42
- puts 'Input your guess:'
43
- user_input = gets.chomp
44
- next unless game.validate_guess(user_input)
45
- if user_input == "hint"
46
- puts game.show_hint
47
- elsif user_input == "exit"
48
- break
49
- else
50
- puts game.try_guess(user_input)
51
- end
52
- end
53
- end
54
-
55
- def game_process
56
- hello_message
57
- loop do
58
- menu
59
- case gets.chomp
60
- when "Start" then play_game
61
- when "Rules" then puts Game.rules
62
- when "Stats" then puts Game.stats
63
- when "Exit" then break
64
- else puts "You have passed unexpected command. Please choose one from listed commands"
65
- end
66
- end
67
- goodbye_message
68
- end
69
-
70
- def write_to_file(filename, data)
71
- File.open(filename, 'w') { |file| file.write(data.to_yaml) }
72
- end
73
-
74
- #puts(File.expand_path('lib/data'))
75
- #write_to_file(File.expand_path('lib/data') + 'data.yml', "Hello world")
76
- game_process