Word Search

Post

Posted
Rating:
Item has a rating of 5 (Liked by sholzyLiked by gbWilly)
#1 (In Topic #1938)
Avatar
Guru
cogier is in the usergroup ‘unknown’
cogier is in the usergroup ‘GambOS Contributor’
I would welcome any input regarding the attached program. It still contains some bug tracking code, just in case!
WordSearch
Attachment

WordSearch-0.0.1.tar.gz

Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Administrator
sholzy is in the usergroup ‘unknown’
I like these kind of brain challenging games.  :thumbs:

I just downloaded it and looking forward to checking it out later today.  I'll report back my adventures.

sholzy
Gambas One Site Director

To report bugs in the Gambas IDE:
Official Gambas Bug Tracker
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Expert
Quincunxian is in the usergroup ‘Expert’
Hi Cogier,
Where did you get the word list from ?

I've tried this with the idea that I could use other language dictionaries at some point.

Private Function GetRandomWord() As String
  
  Dim TmpStr As String
  Dim NewWord As Boolean = False
  Dim ShellParam As String
  Dim DictWordCount As Integer = 101000
  Dim DictionaryName As String = "american-english"
  'Dim DictionaryName As String = "british-english"
  Tlb_ScoreBoard.Text = "Searching for word"
  Repeat
    ShellParam = "awk -v lineno=" & Str(Rand(1, DictWordCount)) & " 'lineno==NR{print;exit}' /usr/share/dict/" & DictionaryName
    Shell ShellParam To TmpStr
    TmpStr = LCase(TmpStr)
    TmpStr = Replace(TmpStr, "'s", "") ' Many of the words in the dictionary have a plural suffix
    TmpStr = Replace(TmpStr, "\n", "") ' Remove the 'new line' characters
    
    If Not UsedWords.Exist(TmpStr) Then NewWord = True
    If ((Len(TmpStr) < WaterDropLengthMin) Or (Len(TmpStr) > WaterDropLengthMax)) Then NewWord = False ' This sets up checking if the word length is between specific sizes ie > 4 and < 8
  Until NewWord
  UsedWords.Add(Str(UsedWords.Count + 1), TmpStr) ' UsedWords is a standard collection to ensure that I don't get double ups. 
  Return TmpStr
  
End

 

Cheers - Quin.
I code therefore I am
Online now: No Back to the top

Post

Posted
Rating:
#4
Avatar
Guru
cogier is in the usergroup ‘unknown’
cogier is in the usergroup ‘GambOS Contributor’

Where did you get the word list from? said


Hi Quin,

It was a long time ago when I downloaded this list, and I don't remember where I got it from, but a quick Google came up with this: - Dictionaries
Online now: No Back to the top

Post

Posted
Rating:
#5
Avatar
Expert
Quincunxian is in the usergroup ‘Expert’
Thanks for the link. That will be very useful. I'll download and review

I've collected some text file lists that I've discoverred over the years. Like you, I can't remember where from and if you or anybody else is interested I'll post them up.
  • Male first names (2,943)
  • Female first names (5,001)
  • International surnames (13,460)
  • International currency codes.
I used these when creating a random name generator for stories and even tried my hand at a random name/word generator which I need to polish up.


 

Cheers - Quin.
I code therefore I am
Online now: No Back to the top
1 guest and 0 members have just viewed this.