473,503 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

to make worrd puzzle through python programming

4 New Member
is there any way we can make word puzzle using python programming in 2 dimensional way???
i made 'file_name.txt' containing (asdfghklo)
and i need to make some valid words from that txt file (sad,had,gas), which i saved on a 'input_word.txt', can we make our program that read these two files and ??
i got this so far:-


'''Original puzzle:
| a | s | d |
| f | g | h |
| k | l | o |
Valid words in the puzzle are:
sad
had
gas'''

AND IM TRYING TO GET WORD PUZZLE LIKE THIS TO FIND WORD PUZZLE HORIZONTALLY, VERTICALLY, AS WELL AS DIAGONALLY:-

'''Solved puzzle:
| G | S | |
| H | A | D |
| | D | S |'''



PLEASE HELP ME IF THERE IS SOME WAY TO DO SO...
THANK YOU IN ADVANCE
Oct 3 '14 #1
2 1691
dwblas
626 Recognized Expert Contributor
What about dog and fog and log and dad and lad, etc. You will have to use a dictionary to tell if a word is valid or not since there are words that many of us wouldn't recognize. You can use permutations, so using the following code, every word would be checked against a dictionary to see it is a valid word.
Expand|Select|Wrap|Line Numbers
  1. from itertools import permutations
  2.  
  3. ##  ----- three letter words
  4. for item in permutations("asdfgho", 3):
  5.     print "".join(item) 
And a link to Python's Sudoku programs since I am not at all sure if you are asking about it or not.
Oct 3 '14 #2
pythonlearner
4 New Member
can we do this by using a function?im new to python, and i want to know if there is some way to do it by using function.
thank you.
Oct 8 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2279
by: asdf sdf | last post by:
i'm interested in using python for win32 COM automation and sysadmin scripts. many recommendations for Mark Hammond's Python Programming on Win32. but it was published four and half years ago....
2
1437
by: dm | last post by:
Hi: I want to program using VB mixed python. who have any experience? and hwo to do ? thanks dm
4
2407
by: Mark | last post by:
Hello. I am new to programming and Python and was wondering if someone could help get me started. I picked Python to start learning to prgram because of some things I have read about it (easy to...
0
1327
by: Ram Ravi | last post by:
I would like to get the SourceCode for Rick Hightower book "Python programming with Java Classes" (jython book). I went to rickhightower.com and got Connection refused message. Does somebody...
13
2251
by: Brian Quinlan | last post by:
I've decided that it would be be fun to host a weekly Python programming contest. The focus will be on algorithms that require a bit of thought to design but not much code to implement. I'm...
0
1118
by: Tin | last post by:
Hi, I have listed Python Programming Patterns ISBN:0130409561 on ebay.co.uk A brand new with really cheap price-4.99 If you are interested, go and have a look at www.ebay.co.uk and locate...
23
2093
by: herraotic | last post by:
I have been getting ready to learn programming for a long time, installed a GNU/Linux operating system, learnt the ins and outs but I think it is time to pick up a book and learn to now program. ...
11
1573
by: John Coleman | last post by:
Greetings, My copy of the second edition of Chun's "Core Python Programming" just arrived from Amazon on Friday. What really jumped out at me is an interesting feature about how it sequences its...
2
8221
by: Ali seaman | last post by:
Hi all, I have a question on how to Create a graphical user interface with Python programming language and integrate it with CATIA V5-API ?( I am working in the Field of Mechanical engineering...
1
3609
by: PyGIS | last post by:
Hi friends : i'm beginner in python programming . i red learning python book ( o'relly) . it was very useful and interesting for me . now i want to read more advanced book (intermediate ) for...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7463
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3157
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
738
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
389
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.