Word games 
Author Message
 Word games

Hi,

  I'm attempting to create a couple of simple word games in powerbasic/cc.
I've a word list that is HUGE! We're talking 1.4Mb for words from 3 to 9
characters long.

  I've attempted to use DATA statements in PB/cc to include the words into the
.exe file to no avail. I've split the list several different ways but just
can't get the compiler to accept them all. Any ideas? Like, maybe, including
the data as a resorce? If so, how and how do I access them?

  I think J. McClendon once posted a routine to find all the different
permiations of a given string of characters. If you're out there Jud (or
anyone) I'd like to have a copy of it again, please.

TIA,

   ____    _    ____      ____  _____
  |  _ \  / \  / ___) __ | ___)(_   _) Don Schullian

  |____//_/ \_\(____/\__/|_|     |_|    www.DASoftVSS.com
  ___________________________________   www.basicguru.com
      Vertical Software Solutions



Thu, 13 Jun 2002 03:00:00 GMT  
 Word games
The limitation on the total size of DATA statements in PB/CC is a known
issue and has been discussed on the PB Web BBS. There are no doubt some good
ideas there. (http://www.powerbasic.com, follow the links to the "peer
support" BBS). There is a complete searchable archive of threads available.

You can structure text strings as string resources; but there is a
limitation on both the number (64K, I think) and total size (unknown, but I
think it's based on the resource compiler rather than the PB compiler) of
the resources.

Best idea might be to store the data in a disk file and load it as required;
you can use the Windows API functions (LzOpen, LzRead, etc.) to
compress/decompress the files to save disk storage.

--
Michael Mattias
Racine WI USA


Quote:

>  I'm attempting to create a couple of simple word games in PowerBASIC/cc.
>I've a word list that is HUGE! We're talking 1.4Mb for words from 3 to 9
>characters long.

>  I've attempted to use DATA statements in PB/cc to include the words into
the
>.exe file to no avail. I've split the list several different ways but just
>can't get the compiler to accept them all. Any ideas? Like, maybe,
including
>the data as a resorce? If so, how and how do I access them?



Thu, 13 Jun 2002 03:00:00 GMT  
 Word games

Quote:

>  I think J. McClendon once posted a routine to find all the different
>permiations of a given string of characters. If you're out there Jud (or
>anyone) I'd like to have a copy of it again, please.

Well, ya dummy! Why don't you go over to Jud's page and just d/load it!!!
Geeze what a nut!!!!

   ____    _    ____      ____  _____
  |  _ \  / \  / ___) __ | ___)(_   _) Don Schullian

  |____//_/ \_\(____/\__/|_|     |_|    www.DASoftVSS.com
  ___________________________________   www.basicguru.com
      Vertical Software Solutions



Fri, 14 Jun 2002 03:00:00 GMT  
 Word games


Quote:
>Hi,

>  I'm attempting to create a couple of simple word games in PowerBASIC/cc.
>I've a word list that is HUGE! We're talking 1.4Mb for words from 3 to 9
>characters long.

>  I've attempted to use DATA statements in PB/cc to include the words into the
>.exe file to no avail. I've split the list several different ways but just
>can't get the compiler to accept them all. Any ideas? Like, maybe, including
>the data as a resorce? If so, how and how do I access them?

Why not just have them in a large text file? and load that into an
array at run time? it'd certainly be less hassle than having it all as
a resource.

TTFN
Arclight



Fri, 14 Jun 2002 03:00:00 GMT  
 Word games
I am not sure what your game is about, but fixed length records using a random
access file would be a good way to go since your maximum word size is only 9
bytes. This gives you a huge speed advantage if you will be seeking data in any
way other than sequentially.

Grant Fullmer
GeoInformatics

Quote:

> Hi,

>   I'm attempting to create a couple of simple word games in PowerBASIC/cc.
> I've a word list that is HUGE! We're talking 1.4Mb for words from 3 to 9
> characters long.

>   I've attempted to use DATA statements in PB/cc to include the words into the
> .exe file to no avail. I've split the list several different ways but just
> can't get the compiler to accept them all. Any ideas? Like, maybe, including
> the data as a resorce? If so, how and how do I access them?

>   I think J. McClendon once posted a routine to find all the different
> permiations of a given string of characters. If you're out there Jud (or
> anyone) I'd like to have a copy of it again, please.

> TIA,

>    ____    _    ____      ____  _____
>   |  _ \  / \  / ___) __ | ___)(_   _) Don Schullian

>   |____//_/ \_\(____/\__/|_|     |_|    www.DASoftVSS.com
>   ___________________________________   www.basicguru.com
>       Vertical Software Solutions



Fri, 14 Jun 2002 03:00:00 GMT  
 Word games
You might want to look into SOUNDEX's and Metaphones.  It would allow you
to do comparisons of words against the entire list much more quickly than
a "brute force" scan.

That's how most spell checkers work.

--Dave


Quote:
> I am not sure what your game is about, but fixed length records using a random
> access file would be a good way to go since your maximum word size is only 9
> bytes. This gives you a huge speed advantage if you will be seeking data in any
> way other than sequentially.

> Grant Fullmer
> GeoInformatics


> > Hi,

> >   I'm attempting to create a couple of simple word games in PowerBASIC/cc.
> > I've a word list that is HUGE! We're talking 1.4Mb for words from 3 to 9
> > characters long.

> >   I've attempted to use DATA statements in PB/cc to include the words into the
> > .exe file to no avail. I've split the list several different ways but just
> > can't get the compiler to accept them all. Any ideas? Like, maybe, including
> > the data as a resorce? If so, how and how do I access them?

> >   I think J. McClendon once posted a routine to find all the different
> > permiations of a given string of characters. If you're out there Jud (or
> > anyone) I'd like to have a copy of it again, please.



Fri, 14 Jun 2002 03:00:00 GMT  
 Word games
Can i suggest a silly QBasic solution?
Put the words in a file
Index each word in the file in a separate file or when initizlizing
the program.
Using the index, read the words as you need
Best regards
Antoni
Quote:
>  I'm attempting to create a couple of simple word games in PowerBASIC/cc.
>I've a word list that is HUGE! We're talking 1.4Mb for words from 3 to 9
>characters long.

>  I've attempted to use DATA statements in PB/cc to include the words into the
>.exe file to no avail. I've split the list several different ways but just
>can't get the compiler to accept them all. Any ideas? Like, maybe, including
>the data as a resorce? If so, how and how do I access them?



Fri, 14 Jun 2002 03:00:00 GMT  
 Word games


Quote:


>>Hi,

>>  I'm attempting to create a couple of simple word games in PowerBASIC/cc.
>>I've a word list that is HUGE! We're talking 1.4Mb for words from 3 to 9
>>characters long.

>>  I've attempted to use DATA statements in PB/cc to include the words into the
>>.exe file to no avail. I've split the list several different ways but just
>>can't get the compiler to accept them all. Any ideas? Like, maybe, including
>>the data as a resorce? If so, how and how do I access them?
>Why not just have them in a large text file? and load that into an
>array at run time? it'd certainly be less hassle than having it all as
>a resource.

Well, I've done that (of course) but as long as they're in a seperate file
they can, and will, be messed with by the users/players unless I scramble the
letters and THAT will take more time that I wish to put the users through.

C'ya,

   ____    _    ____      ____  _____
  |  _ \  / \  / ___) __ | ___)(_   _) Don Schullian

  |____//_/ \_\(____/\__/|_|     |_|    www.DASoftVSS.com
  ___________________________________   www.basicguru.com
      Vertical Software Solutions



Sat, 15 Jun 2002 03:00:00 GMT  
 Word games


Quote:
>You might want to look into SOUNDEX's and Metaphones.  It would allow you
>to do comparisons of words against the entire list much more quickly than
>a "brute force" scan.

>That's how most spell checkers work.

I thought about that, Dave. I've culled the list to 8 letters as that works
with the screen better and I'm now thinking about using Quads. Right now I'm
using a binary search on an array held in memory and can create a list of
'good' words in about 5 seconds using a variant of Jud McClendon's PERM.BAS.

Thanks,

   ____    _    ____      ____  _____
  |  _ \  / \  / ___) __ | ___)(_   _) Don Schullian

  |____//_/ \_\(____/\__/|_|     |_|    www.DASoftVSS.com
  ___________________________________   www.basicguru.com
      Vertical Software Solutions



Sat, 15 Jun 2002 03:00:00 GMT  
 Word games



Quote:




> >>Hi,

> >>  I'm attempting to create a couple of simple word games in
PowerBASIC/cc.
> >>I've a word list that is HUGE! We're talking 1.4Mb for words from 3 to 9
> >>characters long.

> >>  I've attempted to use DATA statements in PB/cc to include the words
into the
> >>.exe file to no avail. I've split the list several different ways but
just
> >>can't get the compiler to accept them all. Any ideas? Like, maybe,
including
> >>the data as a resorce? If so, how and how do I access them?
> >Why not just have them in a large text file? and load that into an
> >array at run time? it'd certainly be less hassle than having it all as
> >a resource.

> Well, I've done that (of course) but as long as they're in a seperate file
> they can, and will, be messed with by the users/players unless I scramble
the
> letters and THAT will take more time that I wish to put the users through.

A simple XOR encryption will probably do... unless you release the source
code

    Frits van Bommel



Sat, 15 Jun 2002 03:00:00 GMT  
 Word games


Quote:
>Well, I've done that (of course) but as long as they're in a seperate file
>they can, and will, be messed with by the users/players unless I scramble the
>letters and THAT will take more time that I wish to put the users through.

Don

Assuming you/your_users have the horsepower to decrypt on_the_fly
without appreciable extra delay, any relatively straightforward
encryption scheme should keep all but the most determined out.

Once upon a time (early eighties) we used an old DEC compact storage
system to keep the curious out of the password file.  It was basically
RAD50 with a little extra - XOR with a known mask.  As you are only
dealing with plain text, sixbit or rad50 would do fine as the basis.

FWIW

Peter



Sat, 15 Jun 2002 03:00:00 GMT  
 Word games


Quote:
>You might want to look into SOUNDEX's and Metaphones.  It would allow you
>to do comparisons of words against the entire list much more quickly than
>a "brute force" scan.

>That's how most spell checkers work.

Whoa!! I converted the words to QUAD INTEGERs and started processing them as
such. Would you believe that the times dropped from ~30seconds to ~1 second! I
guess that's fast enough to process all the possible combinations of letters
from lengths of 3 to 8 characters found in an eight letter word.

C'ya,

   ____    _    ____      ____  _____
  |  _ \  / \  / ___) __ | ___)(_   _) Don Schullian

  |____//_/ \_\(____/\__/|_|     |_|    www.DASoftVSS.com
  ___________________________________   www.basicguru.com
      Vertical Software Solutions



Sat, 15 Jun 2002 03:00:00 GMT  
 Word games


Quote:




>>>Hi,

>>>  I'm attempting to create a couple of simple word games in PowerBASIC/cc.
>>>I've a word list that is HUGE! We're talking 1.4Mb for words from 3 to 9
>>>characters long.

>>>  I've attempted to use DATA statements in PB/cc to include the words into the
>>>.exe file to no avail. I've split the list several different ways but just
>>>can't get the compiler to accept them all. Any ideas? Like, maybe, including
>>>the data as a resorce? If so, how and how do I access them?
>>Why not just have them in a large text file? and load that into an
>>array at run time? it'd certainly be less hassle than having it all as
>>a resource.

>Well, I've done that (of course) but as long as they're in a seperate file
>they can, and will, be messed with by the users/players unless I scramble the
>letters and THAT will take more time that I wish to put the users through.

just XOR it with a constant byte, they won't even notice the speed
difference, and most people won't be able to change it, only the
people who really want to will, but there isn't really much you can do
to stop the really determined people.

TTFN
Arclight



Sat, 15 Jun 2002 03:00:00 GMT  
 Word games
Sounds like you read my article, "Waste Not, Want Not" in the January, 1998
issue of BASICally Speaking.

I suggested converting two and four byte strings to integers and longs if
multiple comparisons needed to be done. I never tried it with quads, though;
but it's nice to know that you get the performance increase using those,
too.

Question: Did you use Boolean operators to manipulate your bytes? Or just
"regular" add/subtract/multiply/divide? Or maybe SHIFT?

--
Michael Mattias
Racine WI USA

Quote:

>Whoa!! I converted the words to QUAD INTEGERs and started processing them
as
>such. Would you believe that the times dropped from ~30seconds to ~1
second! I
>guess that's fast enough to process all the possible combinations of
letters
>from lengths of 3 to 8 characters found in an eight letter word.



Sun, 16 Jun 2002 03:00:00 GMT  
 Word games


Quote:


>>Well, I've done that (of course) but as long as they're in a seperate file
>>they can, and will, be messed with by the users/players unless I scramble the
>>letters and THAT will take more time that I wish to put the users through.

>Don

>Assuming you/your_users have the horsepower to decrypt on_the_fly
>without appreciable extra delay, any relatively straightforward
>encryption scheme should keep all but the most determined out.

>Once upon a time (early eighties) we used an old DEC compact storage
>system to keep the curious out of the password file.  It was basically
>RAD50 with a little extra - XOR with a known mask.  As you are only
>dealing with plain text, sixbit or rad50 would do fine as the basis.

Well, the alpha of the program is up and running. I'll encode the words using
a simple 'replacement' scheme. As I'm only using 26 characters (no spaces or
places) and CHR$(0) and replacing all the letters with CHR$(1) -> CHR$(26)
that should be quite enough to keep the inquisitive noses out of the deck.

I've also solved the 'speed' problem by using words of 8 characters or less
and treating them like QUAD INTEGERS. This little trick speeded things from 30
seconds per list build to ~1 second per list.

I'll post the game(s) on my site when I get her running for all of you who
like to waste time and kill brain cells.

Thanks to all.

   ____    _    ____      ____  _____
  |  _ \  / \  / ___) __ | ___)(_   _) Don Schullian

  |____//_/ \_\(____/\__/|_|     |_|    www.DASoftVSS.com
  ___________________________________   www.basicguru.com
      Vertical Software Solutions



Sun, 16 Jun 2002 03:00:00 GMT  
 
 [ 17 post ]  Go to page: [1] [2]

 Relevant Pages 

1. newbie's word game

2. Word game

3. LOGO-L> Shuffling words & Word Games

4. LOGO-L> Shuffling words & Word Games

5. LOGO-L> Shuffling words & word games

6. Game Magazine for Shareware Game Developers.

7. Gaming Revolution: Games in Phones with Java: JavaOne Web Casts

8. Python in game development [fwd: best prog lang for games]

9. game theoretic semantics, dialogic logic & dialogue games

10. Gaming with the idea for games

11. How to replace one or two words with one word with one line of awk code

12. unsigned word to signed word in RB

 

 
Powered by phpBB® Forum Software