Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Lista słów A2
- a2_words = {
- "ability", "able", "about", "above", "accident", "activity", "actor", "actress", "add", "address", "adult",
- "advice", "aeroplane", "afraid", "after", "afternoon", "again", "against", "age", "ago", "agree", "air",
- "airport", "album", "all", "all right", "almost", "along", "already", "alright", "also", "always", "amazing",
- "ambulance", "amount", "and", "angry", "animal", "another", "answer", "any", "anybody", "anyone", "anything",
- "anywhere", "apartment", "apple", "April", "area", "arm", "around", "arrive", "art", "article", "artist",
- "as", "ask", "at", "aunt", "autumn", "away", "baby", "back", "bad", "bag", "bake", "ball", "banana", "band",
- "bank", "bar", "base", "baseball", "basket", "basketball", "bath", "bathroom", "be", "bean", "bear", "beautiful",
- "because", "become", "bed", "bedroom", "beer", "before", "begin", "behind", "believe", "bell", "below", "best",
- "better", "between", "bicycle", "big", "bike", "bill", "bird", "birthday", "black", "blond", "blog", "blue",
- "board", "boat", "body", "boil", "book", "boot", "bored", "boring", "both", "bottle", "box", "boy", "boyfriend",
- "bread", "break", "breakfast", "bring", "brother", "brown", "build", "building", "bus", "business", "busy",
- "but", "butter", "buy", "by", "bye", "cafe", "cake", "call", "camera", "can", "cannot", "cap", "capital", "car",
- "card", "care", "careful", "carefully", "carry", "cat", "CD", "cent", "center", "century", "certainly", "chair",
- "change", "chart", "cheap", "check", "cheese", "chicken", "child", "chocolate", "choose", "cinema", "city",
- "class", "classmate", "classroom", "clean", "clear", "clearly", "climb", "clock", "close", "clothes", "cloud",
- "club", "coat", "coffee", "cold", "college", "color", "come", "common", "company", "compare", "complete",
- "computer", "concert", "conversation", "cook", "cooker", "cooking", "cool", "correct", "cost", "could",
- "country", "course", "cousin", "cow", "cream", "create", "cricket", "cross", "crown", "cry", "cup", "customer",
- "cut", "dad", "dance", "dancer", "dancing", "dangerous", "dark", "date", "daughter", "day", "dear", "decide",
- "deep", "delicious", "describe", "description", "design", "desk", "dictionary", "die", "different", "difficult",
- "dinner", "dirty", "discuss", "discussion", "dish", "do", "doctor", "dog", "dollar", "door", "down", "draw",
- "dream", "dress", "drink", "drive", "driver", "during", "each", "ear", "early", "east", "easy", "eat", "egg",
- "eighteen", "eighty", "either", "elephant", "eleven", "email", "end", "engine", "enjoy", "enough", "enter",
- "environment", "eraser", "euro", "even", "evening", "event", "ever", "every", "everybody", "everyone",
- "everything", "everywhere", "exam", "example", "excited", "exciting", "exercise", "expensive", "explain",
- "extra", "eye", "face", "fact", "fall", "family", "famous", "far", "farm", "farmer", "fast", "fat", "father",
- "favorite", "feel", "feeling", "festival", "few", "field", "fifteen", "fifth", "fifty", "fill", "film",
- "final", "find", "fine", "finger", "finish", "fire", "first", "fish", "five", "flat", "flight", "floor",
- "flower", "fly", "follow", "food", "foot", "football", "for", "forget", "form", "four", "fourteen", "free",
- "Friday", "friend", "friendly", "from", "front", "fruit", "full", "fun", "funny", "future", "game", "garden",
- "geography", "get", "gift", "girl", "girlfriend", "give", "glass", "glasses", "go", "good", "goodbye",
- "grandfather", "grandmother", "grape", "great", "green", "group", "grow", "guess", "guitar", "hair", "half",
- "hall", "hamburger", "hand", "happen", "happy", "hard", "hat", "hate", "have", "he", "head", "health", "healthy",
- "hear", "heart", "hello", "help", "her", "here", "hi", "high", "history", "hobby", "hold", "holiday", "home",
- "homework", "hope", "horse", "hospital", "hot", "hotel", "hour", "house", "how", "hundred", "hungry", "hurry",
- "hurt", "husband", "I", "ice", "ice cream", "idea", "if", "important", "improve", "in", "include", "information",
- "interested", "interesting", "internet", "into", "invite", "island", "it", "its", "jacket", "jam", "job", "join",
- "journey", "juice", "jump", "just", "keep", "key", "kick", "kid", "kill", "kind", "kitchen", "know", "language",
- "large", "last", "late", "later", "laugh", "lazy", "learn", "leave", "left", "leg", "lemon", "lesson", "let",
- "letter", "library", "lie", "life", "light", "like", "line", "lion", "listen", "little", "live", "long", "look",
- "lose", "lot", "love", "low", "lunch", "machine", "magazine", "main", "make", "man", "many", "map", "market",
- "married", "match", "matter", "may", "maybe", "me", "meal", "mean", "meat", "medicine", "meet", "meeting",
- "member", "message", "meter", "midnight", "milk", "million", "minute", "miss", "mistake", "model", "modern",
- "moment", "money", "monkey", "month", "moon", "more", "morning", "most", "mother", "mountain", "mouse",
- "mouth", "move", "movie", "much", "mum", "museum", "music", "must", "my", "name", "narrow", "national",
- "nature", "near", "neck", "need", "negative", "never", "new", "news", "newspaper", "next", "nice", "night",
- "no", "noise", "noisy", "north", "nose", "not", "note", "nothing", "now", "number", "nurse", "object",
- "ocean", "of", "off", "offer", "office", "often", "oh", "oil", "old", "on", "one", "only", "open", "or",
- "orange", "order", "other", "our", "out", "outside", "over", "own", "page", "paint", "pair", "paper",
- "parent", "park", "part", "partner", "party", "pass", "past", "pen", "pencil", "people", "pepper", "perfect",
- "person", "pet", "phone", "photo", "photograph", "photographer", "physics", "picture", "piece", "pig", "pilot",
- "pink", "pizza", "place", "plane", "plant", "plastic", "plate", "play", "player", "please", "plenty", "pocket",
- "police", "polite", "pool", "poor", "pop", "popular", "possible", "post", "postcard", "potato", "pound",
- "practice", "prefer", "prepare", "present", "pretty", "print", "problem", "program", "project", "pull",
- "purple", "push", "put", "quarter", "question", "quick", "quiet", "radio", "rain", "rainy", "read", "ready",
- "real", "really", "receive", "red", "remember", "repeat", "report", "rest", "restaurant", "return", "rice",
- "ride", "right", "river", "road", "room", "run", "sad", "safe", "salad", "salt", "same", "sandwich", "Saturday",
- "save", "say", "school", "science", "scientist", "score", "sea", "season", "seat", "second", "see", "sell",
- "send", "sentence", "September", "seven", "seventeen", "seventy", "several", "shake", "shall", "shampoo",
- "share", "she", "sheep", "shirt", "shoe", "shop", "shopping", "short", "should", "shoulder", "show", "sick",
- "side", "sign", "silver", "similar", "simple", "since", "sing", "singer", "sister", "sit", "six", "sixteen",
- "sixty", "size", "skate", "skateboard", "ski", "skirt", "sky", "sleep", "slow", "small", "smile", "snow",
- "so", "soap", "soccer", "social", "some", "somebody", "someone", "something", "sometimes", "son", "song",
- "soon", "sorry", "sound", "soup", "south", "space", "speak", "special", "spell", "spend", "sport", "spring",
- "stand", "star", "start", "station", "stay", "steak", "still", "stomach", "stop", "store", "story", "straight",
- "strange", "street", "strong", "student", "study", "stupid", "style", "subject", "success", "sugar", "summer",
- "sun", "Sunday", "supermarket", "sure", "surprise", "swim", "swimming", "table", "take", "talk", "tall", "tape",
- "taste", "taxi", "tea", "teach", "teacher", "team", "tell", "ten"
- }
- # Filtrowanie słów obecnych w modelu
- vocab = [w for w in a2_words if w in model.key_to_index]
- target = random.choice(vocab)
- print("Zgadnij słowo. Wpisz 'exit', by zakończyć.")
- # Funkcja podobieństwa
- def cos_sim(a, b):
- return cosine_similarity([a], [b])[0][0]
- # Zmienna pomocnicza
- last_sim = None
- wrong_guesses = 0
- hint_progress = 0
- # Główna pętla gry
- while True:
- guess = input(">>> ").lower().strip()
- if guess == 'exit':
- print("Koniec gry. Szukane słowo to:", target)
- break
- if guess == target:
- print("Brawo! Zgadłeś/-aś słowo!")
- break
- if guess not in model:
- print("Nie znam tego słowa.")
- continue
- sim = cos_sim(model[guess], model[target])
- if last_sim is None:
- print(f"Podobieństwo: {sim:.4f}")
- else:
- print("Ciepło!" if sim > last_sim else "Zimno!", f"(sim = {sim:.4f})")
- last_sim = sim
- wrong_guesses += 1
- if wrong_guesses >= 3:
- hint_progress = min(wrong_guesses - 2, len(target))
- hint = target[:hint_progress] + "_" * (len(target) - hint_progress)
- print(f"Podpowiedź: {hint}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement