https://github.com/yegor256/hangman
Hangman (the game) written in a very unelegant procedural style, which you can improve in order to test your skills
https://github.com/yegor256/hangman
game hangman-game java oop
Last synced: 3 months ago
JSON representation
Hangman (the game) written in a very unelegant procedural style, which you can improve in order to test your skills
- Host: GitHub
- URL: https://github.com/yegor256/hangman
- Owner: yegor256
- License: other
- Created: 2017-05-22T15:51:41.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-10-27T12:18:39.000Z (8 months ago)
- Last Synced: 2025-03-31T13:19:08.915Z (3 months ago)
- Topics: game, hangman-game, java, oop
- Language: Java
- Homepage: http://www.yegor256.com/elegant-objects.html
- Size: 38.1 KB
- Stars: 34
- Watchers: 5
- Forks: 53
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://github.com/yegor256/hangman/actions/workflows/mvn.yml)
[](https://github.com/yegor256/hangman/blob/master/LICENSE.txt)[Hangman](https://en.wikipedia.org/wiki/Hangman_%28game%29) is a words
guessing game for one player. The computer guesses a word and the user
has to suggest letters one by one. Every time the word contains a letter,
the computer opens it (all of them, if there are a few). Every time the
word doesn't contain a letter, the computer gives a penalty point for
the user. If there are five penalty points, the user looses. If there
are no hidden letters anymore, the computer looses.First, build it:
```
$ mvn clean package
```Then, run:
```
$ java -classpath target/classes hangman.Main
```This Java code is very procedural, imperative, and not elegant at all.
Read about [Elegant Objects](https://www.elegantobjects.org)
and then try to refactor this code and improve. You're welcome to create new classes,
new methods, anything. Just make sure it still builds.
When ready, please submit a pull request.