clean repo

This commit is contained in:
Alexander Popov 2021-02-24 23:03:08 +03:00
parent 7556fb57c5
commit 47797bd9fe
9 changed files with 21 additions and 89 deletions

21
LICENSE Normal file
View File

@ -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.

View File

@ -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(
'<button id="{l}" onclick="offChar(\'{l}\')">{l}</button>'
.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)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -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!')

View File

@ -1,3 +0,0 @@
google
window
horizon