Hangman - Program Must Select Random Word From Text Files?
May 2, 2009
i have to write a simple Hangman game with sum extra features for bonus points.... the funny thing is i can write the code for the extra features such as "adding additional word, help menu...etc",but i cant write the main program,The program must select random word from text files, it have three difficulities, the codes should be the same for all three, just read from different files...(well thats what i think)... i think i hav to use array... but how do i read the contain of the text file into an array n randomly select a word?
[code]...
View 3 Replies
ADVERTISEMENT
Feb 13, 2010
rying to make a program that will pull a word out from a text file and put it in a textbox
View 2 Replies
Feb 25, 2010
Say I have a string like this:
"Hi My Name is {Robert|John|Wayne} and I like the color {blue|green|yellow}"
How do I select a random word in {Robert|John|Wayne} and {blue|green|yellow}?
View 11 Replies
Jul 29, 2009
i've created a hangman game (Fully working) but since you can only "play" with one phrase (10 letters) it gets boring fast. Basic the current game works by on form load i define the slots (10 string which each hold a letter) and give them there letter. then the user type in a text box and if the textbox = any of the slots then the lbl repasenting that slots changes its text from "_" to the letter.
Anyway what I would like the button to do is when the user presses the start button a random number is generated. The program then looks into a textfile and based on which number is generated it takes a certain line (10 characters per line in a phrase) , moves them into the slots and the game starts. Is that possible to code or it too complicated. The textfile will be in the applications folder (words.txt).
View 6 Replies
Feb 7, 2009
How can i make a textbox so like when a button is pressed how can i make the textbox select a random text and put it in its text box.
View 7 Replies
Jan 8, 2011
I'm new to VB and am trying to create something that will change specific words within a DB entry to a random word from a table. My goal is to change swear words to a random word in a separate table (like darn, dang, waterstopper, etc.) So far I have an "Input" table with the text I need to change and a "SwearRep" table with a list of words I need to replace in col "WBad" and their replacements in "WGood".
View 1 Replies
Mar 10, 2010
I'm trying to have this WebBrowser1.Document.GetElementById("box").SetAttribute("value", Random)" I want to have a random Text from selection like
[Code]...
View 4 Replies
May 9, 2012
I basically have 1x text box and 1x button. I also have a text file set out as follows:
Fred Alston
Samuel Takahashi
Toni Tyree
Tonya Engel
[code]....
Except there are about 60 names.When the button is pressed, I want a name to be selected at random and placed into the text box.
View 4 Replies
Apr 19, 2011
I need to pull a random word from a text file in my resource folder (visual Studio 2010) and then have a user enter a letter to see if it is in the word. Yes, Hangman game. There is more, but right now I need to pull from that text file for a start. I know what I have is not even close to right under "Get Word Button", but I'm kind of confused about the process.
Public Class hangMan
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Dim word As New Random
End Sub
[code]....
View 2 Replies
Jan 15, 2012
Im making a text based game that i need to randomly select different numbers of lines from a text file then pass them to a list box.[code]...
First the code needes to identify the 4th element then randomly select lines from lines that contain that element. The code needs to work out how many lines have a matching text to the 4th array then randomly select lines from that total no need for a maximum limit to that number.The same line must only been show the once at a time, but It can then be shown again on a different button click.[code]...
View 3 Replies
Jan 8, 2012
i have this code to select a word in richtextbox.text
[Code]...
i want to select all the word Hello and color it.how can i do that
View 1 Replies
Jan 21, 2011
Building the hangman on hangman and also making a password box. The password box is less important. I can probably figure it out with time.
[code]...
View 5 Replies
May 10, 2009
building the hangman on hangman and also making a password box. The password box is less important. I can probably figure it out with time. The hangman on the other hand, not so much.so far i have this under cmdA:
For counter = 0 To Len(word) - 1
If word(counter) = "a" Then secret = Mid(secret, 1, counter) + "a" + Mid(secret, counter + 2)
[code]......
View 5 Replies
Apr 22, 2009
I am making a basic form that has 1 button and a rich text box.I need to click on the button and have it call a random line from 3 text documents (so 3 lines total) and place them in the rich text box, each on a different line.
"Quick example"
3 Text files
Firstname.txt
Lastname.txt
Number.txt
Click on button named generate and in the text box below it places
First Name: Shara
Last Name: Harrow
Number: Seven
View 1 Replies
Apr 20, 2009
Im designing a program that will read from various text files (preferably RTF files) and then put them into the RTF box in the program when a button is clicked.
Here is the portion of my code that i am referring to.
Try
Dim fileText As String = My.Computer.FileSystem.ReadAllText("c:\" & selectedHero & ".rtf")
infoDisplay.AppendText(fileText)
infoDisplay.Rtf.Format()
Catch
MsgBox("Selected Hero currently has no File with us.")
End Try
Now heres the problem. In the file i have a few pictures and its formatted and what not. I thought since its a RTF file and the Box is RTF it would auto format.... but anyways. It appears like this in the RTF Box.
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\f0\fs20{\object\objemb{\*\objclass Paint.Picture}\objw3000\objh3000{\*\objdata
[CODE]...
Ok so im not sure how i can read from a RTF file and put it in the RTF box with the right format....Ive been searching around for a while.
View 9 Replies
Nov 30, 2008
Basically i am creating a Hangman program using VB 2008 Express edition and need some help.I would like some help on when a user is entering a letter for the word how can i make it so for example if the target word is "MAX" and they enter "M" i would like the lblstatus to update as "M--" obviously i would want it to be able to do it with all 3 letters.
View 2 Replies
Nov 2, 2011
I am building a search engine in vb.net which would have to search for a word entered by the user in 40 text files within the project directory. It should return the results as the total number of matches (text files) and the number of times this word is in each file.
View 5 Replies
Jan 15, 2011
I have most of the coding done, but i don't know how to code my hangman program so that when you enter a wrong letter, a picturebox image would appear eachtime. Also i want to put a limit on the amout of guesses you can have. If possible, i would also like a listbox with the letters that you have guessed wrong stored in it.
Here is my code so far:
Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
[code].....
View 4 Replies
Nov 26, 2009
I got a little program that generates a random line of text from a .txt file and all is working well, at least for the most part.
On occasion I get an error message popup saying "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: Index."
Here's my code:
CODE:
The last bit is where the random number is generated, which I am guessing where the problem itself is, but am unsure as to how to fix it...
View 1 Replies
Oct 24, 2011
I am trying to create a program which will allow users to select multiple files from a list and then burn them all to a playable DVD. It would be wonderful if i could setup a custom menu programatically as well. I have seen some documentation on Imapi 2.0 but i have not been able to find too much suppoert for it. I have also found a few SDK's out there but most are over $1000 which just isnt in the budget.
1) Is there a library included in windows 7 that will allow me to do this.
2) Is there an inexpensive or open source sdk with good documentation out there to do this with
View 4 Replies
Sep 20, 2010
I have a program where a lot of the required information for it is stored in text files. I simply read this information into large arrays. However, I don't think it's necessary to load all the information each time. Rather, it would be more efficient if I could simply search through a list of items to find the one I need and then use the data from it, or to find a similar name and use it elsewhere.
Would I be right in using a database? And is database programming done in SQL? I have a book on it telling me to use the SQL Server (IIRC), so I shouldn't be doing it in the VB.NET Express GUI?
Here's an example of what I would do:
Hex = 03 00 => dex number 003
Search in file Pokemon Dex Numbers
003 returns Bulbasaur
Check Bulbasaur base stats in the base stats file
etc
So basically I'm reusing a lot of information. I think a database would be best and it would all be internal right? I'm getting complaints about access denied to a text file (since it's stored in the program directory in the program files).
So to cap up the few questions I have:
-Databases are done in SQL and not inside the GUI?
-Databases would load internally?
-I could search a database without having to load it into like an array or something?
View 2 Replies
Apr 24, 2012
I am writing an application that will use a OpenFileDialog control that will read a text file into memory and later process it.
I do have the following filter: Text files (*.txt)|*.txt|CSV files (*.csv)|*.csv|Spaced Text files (*.prn)|*.prn|All files (*.*)|*.*"
When I navigate to my test folder that contains a single .txt file, I see that file. When I change the filter to *.cvs that files goes disappears because it has a .txt extension. That is good. But when I select All files *.* it does not re appear? Why and how do I make it appear.
View 5 Replies
Mar 30, 2012
All i want to do is write some text into word... some of the text is normal text the other is bold... how do I achieve this?The samples I have seen, they either do normal text or bold.. but in different lines utilising InsertParagraphAfter()I need to have both in the one lineie how do i do the following line? using vb.net and word automation (word 2010)
View 2 Replies
Jun 15, 2010
Select All Text In A Form Field On tab in vb
View 4 Replies
Mar 15, 2010
I am taking an intro to VB 2008 course and i am having difficulties with a particular project.The project is to calculate to Federal Tax based on income, I am trying to use Select Case but when i run the program it won't output to the text box. i did the problem using If/Else blocks and it worked perfect. Do I have to put the txtTax.text output statement somewhere else?
Private Sub btnCompute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCompute.Click
'Project 3 using Select Case
'Program is to find Federal Income tax[code].....
View 2 Replies
Oct 23, 2011
I am currently working on a program, that you enter certain values/text in and it organises it into a word document automatically,
I found a code online, which has worked a treat, However I'm wondering what lines of code I would need to:
1. Add Bullets or Numbers
2. Add a new line of text (I can add a new paragraph but I don't want a huge space between the two lines)
3. I have around 20 check box's is there a quicker way to check which are selected then write the text in word or do I have to write alot of If Checkbox1.Checked = True then, etc)
View 10 Replies
Mar 12, 2010
I have a table and i have a form as belove-studentid:...stuentname:..sex:....dateofbirth:...when i type the studentid if it has late the program select the data to fill all text box on form
View 1 Replies
Jun 4, 2012
i am working with Visual Basic 2008 and i wanted to know how u can create a random word?
View 8 Replies
Apr 6, 2011
Ok so i would like to have like a list of lets say 500 words. I would like to randomly select 5 of them. Almost like a random number generator. iam using this software http://tiny.cc/2eufdt2k1k
View 2 Replies
Jun 14, 2009
I have search system that works like charm: 1> Searches specific folder for text files which contain specific word 2> Puts those text file names and/or paths to listbox However i want it to put (instead of InputStr) the specific line where word is found in text file to listbox.
[Code]...
View 8 Replies