paitin_hangman 0.1.0
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 +7 -0
- data/.DS_Store +0 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +62 -0
- data/Rakefile +6 -0
- data/bin/games.yml +17 -0
- data/bin/paitin_hangman +5 -0
- data/bin/setup +8 -0
- data/dictionary.txt +41211 -0
- data/games.yml +0 -0
- data/lib/paitin_hangman/.DS_Store +0 -0
- data/lib/paitin_hangman/dictionary.txt +41211 -0
- data/lib/paitin_hangman/extra_methods.rb +80 -0
- data/lib/paitin_hangman/game_data.rb +20 -0
- data/lib/paitin_hangman/game_engine.rb +73 -0
- data/lib/paitin_hangman/levels.rb +180 -0
- data/lib/paitin_hangman/messages.rb +75 -0
- data/lib/paitin_hangman/saved_games.rb +89 -0
- data/lib/paitin_hangman/version.rb +3 -0
- data/lib/paitin_hangman.rb +46 -0
- data/paitin_hangman.gemspec +36 -0
- metadata +154 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 95876b5a8cba2dd48a5ea4e54b5000aca7af882b
|
|
4
|
+
data.tar.gz: d435511921c6cca4559c882937eef2a094666609
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 687afc6b639117acf987a6fa0cc32579acbb282b7fa8cbd796dbfb0a5cc1bc5c8930dc74f2113ea1de783832c6a144c9343efe10e61c41762ffa4b295f154449
|
|
7
|
+
data.tar.gz: ca6039c84ebceb7ba195d3454ebab621add630aaaef88bdafff37f54d5044781d4471523e042e7a1582953bd90454a2916937c7dd99d7a17d205c7ee5289b749
|
data/.DS_Store
ADDED
|
Binary file
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016 Mayowa Pitan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# PaitinHangman
|
|
2
|
+
[](https://codeclimate.com/github/andela-mpitan/paitin_hangman) [](https://codeclimate.com/github/andela-mpitan/paitin_hangman/coverage)
|
|
3
|
+
|
|
4
|
+
Welcome to my new gem! It is just a classic implentation of the Hangman game.
|
|
5
|
+
|
|
6
|
+
To play this game, just follow the smple instructions below
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
Add this line to your application's Gemfile:
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
gem 'paitin_hangman'
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
And then execute:
|
|
17
|
+
|
|
18
|
+
$ bundle
|
|
19
|
+
|
|
20
|
+
Or install it yourself as:
|
|
21
|
+
|
|
22
|
+
$ gem install paitin_hangman
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
This game is a REPL game, i.e it is being played from and with the **Terminal**. To start it just run `paitin_hangman`. Ensure you download the dictionary file from [here](https://drive.google.com/a/andela.co/file/d/0B1C3woZnW_mZQjZpUWlpNEZlTk0/view?usp=sharing) and run the game from the folder the dictionary file is. You can run it from anywhere else but it has not been tested if it will work yet.
|
|
27
|
+
|
|
28
|
+
Once started, the game is very intuitive and easy to follow.
|
|
29
|
+
|
|
30
|
+
## Important note
|
|
31
|
+
In player mode, if the player is typing his word, it will not display on the screen, it will be hidden so as not to give the challenged player undue advantage.
|
|
32
|
+
|
|
33
|
+
*"Welcome to Hangman, the no-nonsense game
|
|
34
|
+
Be smart, then you live. if not, you'll have to die by Hanging.
|
|
35
|
+
You have a couple of options to pick from.....
|
|
36
|
+
Press 'P' or 'play' if you think you are ready for the challenge,
|
|
37
|
+
You may press 'I' or 'instructions' for a short explanation of how to play
|
|
38
|
+
You may continue a previously saved game by pressing 'L' or 'load'
|
|
39
|
+
Or you could just quit by pressing a 'Q' or typing 'quit'"
|
|
40
|
+
"The word to guess is represented by a row of dashes
|
|
41
|
+
These dashes represent each letter of the word.
|
|
42
|
+
Words you cannot use include proper nouns such as names, places, and brands.
|
|
43
|
+
If the guessing player suggests a letter which occurs in the word,
|
|
44
|
+
the other player writes it in all its correct positions."*
|
|
45
|
+
## Extras
|
|
46
|
+
There is a cheat, you should find that by yourself
|
|
47
|
+
|
|
48
|
+
## Development
|
|
49
|
+
|
|
50
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
51
|
+
|
|
52
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
53
|
+
|
|
54
|
+
## Contributing
|
|
55
|
+
|
|
56
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/paitin_hangman.
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
## License
|
|
60
|
+
|
|
61
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
|
62
|
+
|
data/Rakefile
ADDED
data/bin/games.yml
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
--- !ruby/object:PaitinHangman::GameData
|
|
2
|
+
player_name: MJ
|
|
3
|
+
misses: []
|
|
4
|
+
right_guesses: []
|
|
5
|
+
chances: 12
|
|
6
|
+
word_control: ___________
|
|
7
|
+
game_word: superscribe
|
|
8
|
+
count: 0
|
|
9
|
+
--- !ruby/object:PaitinHangman::GameData
|
|
10
|
+
player_name: MJ
|
|
11
|
+
misses: []
|
|
12
|
+
right_guesses:
|
|
13
|
+
- e
|
|
14
|
+
chances: 14
|
|
15
|
+
word_control: _e____________
|
|
16
|
+
game_word: regularization
|
|
17
|
+
count: 1
|
data/bin/paitin_hangman
ADDED