0

I was just wondering if within pygame it was possible to make an anagram game: What I was thinking was making an array with a list of anagrams in it and then when the scene is launched a text line paired with import random would pick a random anagram.

My first question would be with my idea stated above could I set something up so the same anagram won't display twice?

The second question would be how could/ can I integrate an input text box within the game itself and not by using the interpreter?

Rabbid76
  • 177,135
  • 25
  • 101
  • 146
Pthyon
  • 150
  • 9
  • Yes, it's possible. If you don't want the same anagram to display twice in the same session, you can just maintain a "seen" list (or even better, use a set of anagrams and just remove an anagram from the set when you use it). If you don't want the same anagram to ever occur twice, you might have a .anagram_game_seen.txt somewhere with the words that have occurred in it, and you add a word when it comes up. For your second question (which is quite broad), you could for instance do [this](https://stackoverflow.com/questions/46390231/how-to-create-a-text-input-box-with-pygame). – davidlowryduda Apr 03 '19 at 12:59
  • Pygame is all about drawing on the screen. Drawing in pygame means coloring pixels. What you described is text, text input field and some logic. Sounds very simple in terms of graphics. I recommend to start with tkinter or any other gui framework. https://stackabuse.com/python-gui-development-with-tkinter/ – Poolka Apr 03 '19 at 13:18
  • There's a few text-input boxes/controls available from various people. Once of these could be used to input the text in PyGame. Of course, you could make your own too. They're not too complicated. – Kingsley Apr 03 '19 at 22:14

0 Answers0