Jump to content

.Net Library for Hangman

RockiLocky
Go to solution Solved by SpaceNugget,

Hey guys,

 

I am currently looking for a library which contains words which are getting used in a dictionary or what ever. I need it for making my hangam game :D.

 

Because I do not want a player to input the word but I want to get the words from a library. It would be nice if there is an english and a german version of it.

 

 

Hope you guys can help me out.

Nice Greets Rocki

just leave the words in a text file and read them using StreamReader or some other stream class. Keep the program small and have a separate file for data. this also has the bonus that people can easily use your programs with different languages, or update them to add new words.

Hey guys,

 

I am currently looking for a library which contains words which are getting used in a dictionary or what ever. I need it for making my hangam game :D.

 

Because I do not want a player to input the word but I want to get the words from a library. It would be nice if there is an english and a german version of it.

 

 

Hope you guys can help me out.

Nice Greets Rocki

Link to comment
Share on other sites

Link to post
Share on other sites

Why not just google "hangman word list" or something and then put all of the words into an array or whatever and then use a random integer to get a word from the list/array's index? Or am I missing something? If you just want the words to use with your game, couldn't you simply do that?

Spoiler

System:

i5 3570k @ 4.4 GHz, MSI Z77A-G43, Dominator Platinum 1600MHz 16GB (2x8GB), EVGA GTX 980ti 6GB, CM HAF XM, Samsung 850 Pro 256GB + Some WD Red HDD, Corsair RM850 80+ Gold, Asus Xonar Essence STX, Windows 10 Pro 64bit

PCPP:

http://pcpartpicker.com/p/znZqcf

 

Link to comment
Share on other sites

Link to post
Share on other sites

Why not just google "hangman word list" or something and then put all of the words into an array or whatever and then use a random integer to get a word from the list/array's index? Or am I missing something? If you just want the words to use with your game, couldn't you simply do that?

Yes I could do that but I thought a class with mostly all the words of the language would be easier :D

Link to comment
Share on other sites

Link to post
Share on other sites

Yes I could do that but I thought a class with mostly all the words of the language would be easier biggrin.png

yeah, true.

 

If you cannot find one, and you decide to build one yourself. Consider putting it up for use for others since there will probably be lots of people who would appreciate that.

 

Good luck :)

Spoiler

System:

i5 3570k @ 4.4 GHz, MSI Z77A-G43, Dominator Platinum 1600MHz 16GB (2x8GB), EVGA GTX 980ti 6GB, CM HAF XM, Samsung 850 Pro 256GB + Some WD Red HDD, Corsair RM850 80+ Gold, Asus Xonar Essence STX, Windows 10 Pro 64bit

PCPP:

http://pcpartpicker.com/p/znZqcf

 

Link to comment
Share on other sites

Link to post
Share on other sites

yeah, true.

 

If you cannot find one, and you decide to build one yourself. Consider putting it up for use for others since there will probably be lots of people who would appreciate that.

 

Good luck :)

thanks will do that

Link to comment
Share on other sites

Link to post
Share on other sites

What do you mean by the following?

 

a class with mostly all the words of the language

 

Can you give an example with a few words so I can see what you're looking for?

Link to comment
Share on other sites

Link to post
Share on other sites

What do you mean by the following?

 

 

Can you give an example with a few words so I can see what you're looking for?

 

Words which are getting used in conversations and so on not really anything technical what no normal educated person doesn't know. 

Link to comment
Share on other sites

Link to post
Share on other sites

Words which are getting used in conversations and so on not really anything technical what no normal educated person doesn't know. 

I think what madknight3 is trying to say is that he would like a code example of the class you're talking about with just a few words as an example. It doesn't matter what words, just so that he can, in a technical way, see what you're trying to accomplish when you say that you want words in a class. So again, a code example of this class you want. What words you use in the example are irrelevant.

 

At least I think so. ;)

Spoiler

System:

i5 3570k @ 4.4 GHz, MSI Z77A-G43, Dominator Platinum 1600MHz 16GB (2x8GB), EVGA GTX 980ti 6GB, CM HAF XM, Samsung 850 Pro 256GB + Some WD Red HDD, Corsair RM850 80+ Gold, Asus Xonar Essence STX, Windows 10 Pro 64bit

PCPP:

http://pcpartpicker.com/p/znZqcf

 

Link to comment
Share on other sites

Link to post
Share on other sites

I think what madknight3 is trying to say is that he would like a code example of the class you're talking about with just a few words as an example. It doesn't matter what words, just so that he can, in a technical way, see what you're trying to accomplish when you say that you want words in a class. So again, a code example of this class you want. What words you use in the example are irrelevant.

 

At least I think so. ;)

oh ok give me a sec

 

Edit: Updating something for unity right now so can't get into my VS.

Link to comment
Share on other sites

Link to post
Share on other sites

namespace HangmanWords{    public class Class1    {        private string[] HangmanWords = {"Milk", "Apple", "House", "Capital", "Tomorrow", "Green", "Austria", "United States of America", "and so on..."}; //Need more words        private string mWord;        private int maxWords;        Random r = new Random();        public string Word        {            get            {                return mWord;            }        }        void Randomizeword()        {            maxWords = HangmanWords.Length;            mWord = HangmanWords[r.Next(0, maxWords)];        }    }}

@lubblig @madknight13

 

What I want basically is this above without the randomize thing what I did. I just want an array which I can acces it can be in an library or in a class or whatever with alot of words I can use for Hangman. Thats what I basically want :D
Link to comment
Share on other sites

Link to post
Share on other sites

namespace HangmanWords{    public class Class1    {        private string[] HangmanWords = {"Milk", "Apple", "House", "Capital", "Tomorrow", "Green", "Austria", "United States of America", "and so on..."}; //Need more words        private string mWord;        private int maxWords;        Random r = new Random();        public string Word        {            get            {                return mWord;            }        }        void Randomizeword()        {            maxWords = HangmanWords.Length;            mWord = HangmanWords[r.Next(0, maxWords)];        }    }}
@lubblig @madknight13

 

What I want basically is this above without the randomize thing what I did. I just want an array which I can acces it can be in an library or in a class or whatever with alot of words I can use for Hangman. Thats what I basically want biggrin.png

 

 

Ok, so the code isn't the problem? Just to have a list of words?

 

If so, couldn't you just, like I said, go on like a dictionary/word list website and get a bunch of words and then add them to the array?

 

Or do you just want to have this done for you? wink.png

 

If so, it seems like minor issue. It'll probably take you more time to find a class/library that does exactly this then to just make one yourself? Or am I misunderstanding you?

 

 

How many words are you thinking about adding? Is it thousands or just a couple of hundred or so?

 

 

EDIT:

Btw, you misspelled @madknight3 's username so he wasn't tagged. He'll see it now though.

 

EDIT 2:

 

Here is a list of words you can find with a simple google search. Although, this particular version contains a lot of different endings of the same words. So unless you don't want that you'll have to look somewhere else. But still, this is quite easy and you could make a simple script/program to separate each word for you for it to just be to paste into an array or similar.

Spoiler

System:

i5 3570k @ 4.4 GHz, MSI Z77A-G43, Dominator Platinum 1600MHz 16GB (2x8GB), EVGA GTX 980ti 6GB, CM HAF XM, Samsung 850 Pro 256GB + Some WD Red HDD, Corsair RM850 80+ Gold, Asus Xonar Essence STX, Windows 10 Pro 64bit

PCPP:

http://pcpartpicker.com/p/znZqcf

 

Link to comment
Share on other sites

Link to post
Share on other sites

Hey guys,

 

I am currently looking for a library which contains words which are getting used in a dictionary or what ever. I need it for making my hangam game :D.

 

Because I do not want a player to input the word but I want to get the words from a library. It would be nice if there is an english and a german version of it.

 

 

Hope you guys can help me out.

Nice Greets Rocki

just leave the words in a text file and read them using StreamReader or some other stream class. Keep the program small and have a separate file for data. this also has the bonus that people can easily use your programs with different languages, or update them to add new words.

Link to comment
Share on other sites

Link to post
Share on other sites

just leave the words in a text file and read them using StreamReader or some other stream class. Keep the program small and have a separate file for data. this also has the bonus that people can easily use your programs with different languages, or update them to add new words.

Thats sounds good and I can learn something big from it. Thanks man will try that.

 

 

 

Ok, so the code isn't the problem? Just to have a list of words?

 

If so, couldn't you just, like I said, go on like a dictionary/word list website and get a bunch of words and then add them to the array?

 

Or do you just want to have this done for you? wink.png

 

If so, it seems like minor issue. It'll probably take you more time to find a class/library that does exactly this then to just make one yourself? Or am I misunderstanding you?

 

 

How many words are you thinking about adding? Is it thousands or just a couple of hundred or so?

 

 

EDIT:

Btw, you misspelled @madknight3 's username so he wasn't tagged. He'll see it now though.

 

EDIT 2:

 

Here is a list of words you can find with a simple google search. Although, this particular version contains a lot of different endings of the same words. So unless you don't want that you'll have to look somewhere else. But still, this is quite easy and you could make a simple script/program to separate each word for you for it to just be to paste into an array or similar.

Yeah as you saw there is no problem with code its jsut the words I don't want to type but I will just do that.

Thanks for the input btw and thx for helping

Link to comment
Share on other sites

Link to post
Share on other sites

My recommendation, as others have said, is to grab a word list dictionary from somewhere and load it into an array, or other data structure, at run time.

 

But if you really want it as part of your class file, then write a separate program which takes said word list and formats it into an array so you can copy/paste it into a class file. You can even have the program create the whole class file if you want.

Link to comment
Share on other sites

Link to post
Share on other sites

My recommendation, as others have said, is to grab a word list dictionary from somewhere and load it into an array, or other data structure, at run time.

 

But if you really want it as part of your class file, then write a separate program which takes said word list and formats it into an array so you can copy/paste it into a class file. You can even have the program create the whole class file if you want.

Ok thank you will look into that. Will be a good to learn new stuff.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×