diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ca1c103 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Alexander Popov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/docs/README.md b/README.md similarity index 100% rename from docs/README.md rename to README.md diff --git a/docs/genKeys.py b/docs/genKeys.py deleted file mode 100644 index 25b78a6..0000000 --- a/docs/genKeys.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python3 - -__author__ = 'Alexander Popov' -__version__ = '1.0.0' -__license__ = 'MIT' - -usQwertyKeyboard = 'abcdefghijklmnopqrstuvwxyz'.upper() - -def genKeys(alphabet): - keys = list() - - for letter in alphabet: - keys.append( - '' - .format(l=letter)) - - return(keys) - -if __name__ == '__main__': - with open('keys.html', 'w+', encoding='utf-8') as f: - keyboard = genKeys(usQwertyKeyboard) - - for item in keyboard: - f.write(item) diff --git a/docs/screen.png b/docs/screen.png deleted file mode 100644 index 427cbc9..0000000 Binary files a/docs/screen.png and /dev/null differ diff --git a/docs/game.js b/game.old.js similarity index 100% rename from docs/game.js rename to game.old.js diff --git a/hgman.py b/hgman.py deleted file mode 100644 index 53d24c8..0000000 --- a/hgman.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python3 - -import sys -import random - -__author__ = 'Alexander Popov' -__version__ = '1.0.0' -__license__ = 'MIT' - -wordsDb = list() - -# for count, line in enumerate(sys.stdin): -# if not line in wordsDb: -# wordsDb.append(line.rstrip()) -with open('words.txt', 'r', encoding='utf-8') as f: - for count, line in enumerate(f.readlines()): - if line not in wordsDb: - wordsDb.append(line.rstrip()) - - -class Player: - def __init__(self, gameWord): - self.Health = 6 - self.Word = '-' * len(gameWord) - - def answer(self, newWords=None): - if newWords: - self.Word = newWords - return(self.Word) - - def lives(self): - return(self.Health) - - def crap(self): - self.Health -= 1 - pass - -gameWord = random.choice(wordsDb) -Gamer = Player(gameWord) - -while Gamer.answer() != gameWord: - if Gamer.lives() < 0: - print('You are dead') - break - - print('%d : %s' % (Gamer.lives(), Gamer.answer(),)) - - offWord = input() - - wordIndex = [index for index, char in enumerate(gameWord) - if char == offWord] - - if len(wordIndex) != 0: - for index in wordIndex: - aaa = list(Gamer.answer()) - aaa[index] = offWord - Gamer.answer("".join(aaa)) - else: - Gamer.crap() - -if not Gamer.lives() < 0: - print('Won!') diff --git a/docs/index.html b/index.html similarity index 100% rename from docs/index.html rename to index.html diff --git a/docs/styles.css b/styles.css similarity index 100% rename from docs/styles.css rename to styles.css diff --git a/words.txt b/words.txt deleted file mode 100644 index 2ddc854..0000000 --- a/words.txt +++ /dev/null @@ -1,3 +0,0 @@ -google -window -horizon