pendu 0.0.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: '05983caa3cb8fee2bed043a5346c171d462e5ab075f60a73a36ef09e29dba075'
4
+ data.tar.gz: 6b944e7593ad6470bb6548b9d8e45307b94febdd5b34432db5772143e3f786d7
5
+ SHA512:
6
+ metadata.gz: 5403236c525cf9d1901e573317d1f0c295b7a58bc4fc6a6ef060c1a26da33515ebfb325676353aa652ec5d13169d54837754eb07cd905fada550a199197ad4f9
7
+ data.tar.gz: 5fc676165ba585cba8f13dc7f788200691980c25d1fff693767dd593c5834e7843e040f288e3eab274cb86ff7f0dc76650c471bdb1cb2d00ef80ecf725108797
@@ -0,0 +1,46 @@
1
+ # Le pendu [![](https://img.shields.io/badge/autor-letItCurl-red.svg)](https://www.linkedin.com/in/roland-lopez-developer/?locale=en_US)
2
+ >Install this gem to have a small game in your terminal !
3
+
4
+ <p align="center" >
5
+ <img src="https://res.cloudinary.com/duydvdaxd/image/upload/v1588523135/Vue-Sprint/MyUselessGem_o6zmhf.png">
6
+ </p>
7
+
8
+ # Installation
9
+ ```
10
+ $ gem install pendu
11
+ ```
12
+
13
+ # Usage
14
+ ```
15
+ $ pendu
16
+ // then the game start in your terminal...
17
+ // you can stop this with ctrl+c
18
+ ```
19
+
20
+ # Uninstall
21
+ ```
22
+ gem uninstall pendu
23
+ // and if you are using rbenv:
24
+ rbenv rehash
25
+ ```
26
+
27
+ # About me
28
+
29
+ <table style="border: none;">
30
+ <tr>
31
+ <td>
32
+ <div style="width: 120px;">
33
+ <img style="width: 120px;" src="https://res.cloudinary.com/duydvdaxd/image/upload/w_120,c_fill,ar_1:1,g_auto/v1587723517/Rodeooo_khmmmu.jpg"/>
34
+ </div>
35
+ </td>
36
+ <td>
37
+ <div style="margin-left: 30px;">
38
+ <p>Hey there !</br>
39
+ I'm letItCurl, fullstack developer engineer in freelance a.k.a Roland in real life :p</br>
40
+ If you have any question you can <a href="https://www.linkedin.com/in/roland-lopez-developer/?locale=en_US">contact me</a> if you wish !</p>
41
+ <p>I'm always ready to help !</p>
42
+ <a style="color: #f694ff;" href="mailto:rolandlopez.developer@gmail.com?subject=Hey! Are you available?">Email me</a>
43
+ </div>
44
+ </td>
45
+ </tr>
46
+ </table>
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'pendu'
4
+
5
+ Pendu.new.start
@@ -0,0 +1,28 @@
1
+ require 'useless/wording'
2
+
3
+ class Pendu
4
+ def start
5
+ starting_sentence = "Hola Loco"
6
+ sentence_array = starting_sentence.split("").map(&:downcase)
7
+ accurate_count = sentence_array - [" "]
8
+ final_sentence = starting_sentence.gsub(/[a-zA-Z]/, '_').split("")
9
+
10
+ p "Let's play !"
11
+
12
+ while sentence_array.count("") < accurate_count.count
13
+ puts "Guess a letter:"
14
+ guess = gets.downcase.chomp
15
+ if sentence_array.include?(guess)
16
+ letter_index = sentence_array.find_index(guess)
17
+ sentence_array[letter_index] = ""
18
+ final_sentence[letter_index] = guess
19
+ puts "Correct! The sentence is now: #{final_sentence.join}"
20
+ else
21
+ puts "The letter: #{guess} is not in the sentence. Try again !"
22
+ end
23
+ end
24
+ puts Wording.congrats
25
+ end
26
+ end
27
+
28
+
@@ -0,0 +1,6 @@
1
+
2
+ class Wording
3
+ def self.congrats
4
+ "felicitaciones querido/a !!!!!!!!"
5
+ end
6
+ end
metadata ADDED
@@ -0,0 +1,47 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pendu
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - letItCurl
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2010-05-03 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Viens jouer au pendu !
14
+ email: rolandlopez.developer@gmail.com
15
+ executables:
16
+ - pendu
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - README.md
21
+ - bin/pendu
22
+ - lib/pendu.rb
23
+ - lib/useless/wording.rb
24
+ homepage: https://github.com/letItCurl/pendu
25
+ licenses:
26
+ - MIT
27
+ metadata: {}
28
+ post_install_message:
29
+ rdoc_options: []
30
+ require_paths:
31
+ - lib
32
+ required_ruby_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ required_rubygems_version: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ requirements: []
43
+ rubygems_version: 3.1.2
44
+ signing_key:
45
+ specification_version: 4
46
+ summary: Le jeux du pendu :)
47
+ test_files: []