Hangman Game Substring And Dash

Oct 20, 2011

my teacher assigns me to modify the program hangman game that allow a player to enter a word that contains any letters up to 10 letters.That assignment is from my textbook, Programming with MS Visual Basic 2010 by Diane Zak.[code]Now here's the problem I'm having trouble with. I don't know if my substrings is wrong or right, but when I type a word, the problem crashes and gives me the error of this.and another problem I'm having trouble with is how can I have dashes to match with the length of words? For example, if I type "game", it'll display "----" in the exe program. If I type "cat", it'll display "---" in the exe program as well.

View 14 Replies


ADVERTISEMENT

Hangman Game / Automatically Displays Character And Gives A Game Over?

May 8, 2009

I am a student working on the venerable "Hangman" project. We were tasked to create a hangman game that would get a random word from one of three sources either by file, by array, or by database file. I have managed to get a random word to import from all three but I run into a problem once I start to play the game. The program seems to run into an infitinite loop as soon as you enter a letter or it automatically dispays character entered and gives a game over. [code]............

View 39 Replies

Add Pictures Into Hangman Game?

Jan 27, 2011

I need directions on which code to use to load picture for each wrong guess.

View 5 Replies

How To Make A Hangman Game

Dec 19, 2011

i'm trying to make a hangman game yet i'm getting errors in these parts:

System.Text.RegularExpressions.Regex.ism...rgx, that it is not part of system .text ( more than

one case of this error) and also the rgx bit is claiming to need a '<' for an xml tag.those errors

and quickly run it on their vb? this is because i do not have vb on my computer.[code...]

View 1 Replies

Planning For Is A Hangman Game?

Jan 1, 2009

my new game im planning for is a hangman game. I was thinking along the lines of : having a keybaord on the bottom of the form. Then having parts of the "MAN" be invisible and when a wrong letter is incorrectly pressed a peice becaomes visible! Im having trouble with how to set words. (i want more than 1 word so that it can be played multiple times).

View 1 Replies

Game Programming :: Got Errors In Hangman

May 14, 2009

got errors in hangman

View 3 Replies

Hangman Game In VB Console Application

Dec 15, 2011

I have this progamm and i want to add points when a letter is found 10 points PLZ HELP ME! i also want to make it for two players

Module Module1
Public zoes As Byte
Sub Main ()

[CODE]...

View 2 Replies

HangMan Game - Project That Has A Graphical Interface ?

Apr 20, 2009

I am working on this hangman project that has a graphical interface where the user has 2 options either guess the entire phrase or use a combo box to guess letters. I have the guess text box working but I can't for the life of me figure out why it is not working correctly with the combo box. The following is my entire code for the project. I have it setup to show me which phrase it randomly selected but when ever I pick a letter in that phrase it doesn't fill it in or anything. I'm thinking it is an issue with my loops.

I highlighted the section where the problem is occurring.

Public Class frmHang
Dim strWord(10) As String 'array of answer cchoices
Dim strAnswer As String 'the correct answer

[CODE]...

View 6 Replies

VS 2008 Beginner Making Hangman Game?

Mar 31, 2009

Im using Visual Basic 2008.Okay I got all the design, and everything set up, even the hangman body parts coming on the screen and stuff. So my problem is creating the BLANKS, the underscores "_", and replacing them with a letter...

I was thinking creating Lables which i have no idea how to dynamically. Then giving each label name the letters they belong to, and everytime the user gets the rigth letter they get replaced.

View 3 Replies

Make A Hangman Game For School Using VB 2008 Express?

Dec 1, 2011

I have to make an hangman game for school using visual basic 2008 express and make it a console application...because i need better mark i want to show an image when a player loses or wins(i think it can be done with windows application)...

View 9 Replies

Making A Hangman Style Game In VB 2008 Express?

Jun 1, 2009

I am making a hangman style game in VB 2008 Express. I am a beginner and instead of making any graphic related content (i.e. the hang man), I am using a 3 strike system. So far, I am just about finished. Only problem is whenever I choose a letter that is incorrect, it adds 1 to the strike label. The problem is, the second time I choose an incorrect letter, the "1" does not change to 2! The line is as fallowed:

strikelbl.Text = +1

View 3 Replies

Game Programming :: Creating A Hangman Program Using VB 2008 Express Edition?

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

Hangman Game - Generate Random Number When User Press Start Button

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

Build Hangman In Hangman & Password Box?

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

Building The Hangman In Hangman & Password Box?

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

C# - Prepend A Substring If The Source String Does Not Begin With The Same Substring?

Oct 10, 2011

I'm trying to create a valid RegEx replacement pattern for correctly formatting specific .XML file names. Specifically, if a file name does not begin with a prefix, let's say, ACE_. If the XML file name and extension does not begin with ACE_, prepend the string ACE_ to the file name.For example, if my input source string is the following:

Widgets.xml

I would like to execute a single RegEx Replacement that would result in the string being:

ACE_Widgets.xml.

Conversely, if the string already begins with ACE_, I would like it to remain unchanged. Also,how can I include the pattern ".xml" to ensure that the string pattern for the file name and extension ends with ".xml" in the same matching pattern for the RegEx Replacement pattern? As for the match, I have some luck with the following:

^ACE_{1}[dD]+

Which indicates there is a match for the pattern if the input string is ACE_Widgets.xml and no match if the string is Widgets.xml
The RegEx pattern would suffice, but if you need to know the language in which I'd like to use the replacement pattern is in .NET 4.0 in either C# or VB.NET.

The following posting is close to what Im looking for, but with the inclusion of the *ix directory path prefix, and the use of preg_replace() in PHP, I'm having a bit of a struggle getting it to work with what I need to do:

Regular Expression: How to replace a string that does NOT start with something?

View 3 Replies

[2008] Richtextbox Substring - Select A Substring With 2 Criteria?

Feb 3, 2009

How will I select a substring with 2 criteria? I have a Richtextbox where I select a number after a : with this code; For Each line As String In Richtextbox1.Lines Dim equalsPos As Integer = line.IndexOf(":") + 1 txtFound.AppendText(line.Substring(equalsPos, line.Length - equalsPos)) Next This is working ok, but the whole line.length is appended for number2. The line ex. Some text:my number some text-my number2. I want my number appended to txtFound, and my number2 appended to txtFound2. With my code only number2 can be appended correct.

View 4 Replies

Implementing A Long Dash?

Jun 21, 2012

I used to do this by eg String(52,95). (Getting 52 repetitions of an underscore) Cannot make out how to do it in dot net. I realise that String is no longer right but Str is not working either.

View 3 Replies

Insert Dash Every 4 Characters?

May 18, 2012

I have a function that out puts letters or numbers like: S51AF36W562251DWD4DW

and what I want to do is in the same function after the string has been generated I want to

add some dashes in between the string so it looks like this: S51A - F36W - 5622 - 51DW - D4DW.

This should be so simple to do but I can't figure it out.. I've tried String.Replace, text.trim, etc.

View 3 Replies

Storing A Dash Style In Listview?

Jul 13, 2010

Is there a way to store a graphics pen dashstyle in a listview sub item cell?

View 4 Replies

VS 2008 - Trying To Insert Dash After Five Characters

Aug 28, 2010

I'm trying to insert a - after ever 5 chars. I made this code.
Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
If TextBox1.Text.Length = "5" Then
TextBox1.Text += "-"
End If
[Code] .....
But the mouse returns always to the left after it enters a -.

View 5 Replies

Create Variable Which Would Have Dash " Inside

Feb 22, 2012

Like in topic.I want adddashes to variable.So textbox1.text = "Nice "weather" is..."BUT it's not working :/ when I'm using dashes VB 2010 thinks that I want close

View 6 Replies

VS 2008 Hangman Code Not Working?

May 22, 2011

my Hangman Codes aren't working and i'm stuck at the part where it searches the word to see if the letter/word is in the word to guess and then i would like some pointers on how to go about making this D**n thing work.Here's the code i got so far.'I Know that i have some things in here twice and in different ways but that's because one didn't work so i tried another and that didn't work either i had them annotated out for debugging'

Public Class Form1
Dim strLetterGuessed As String = ""
Dim strWordGuessed As String = ""

[code]....

View the attachment to see what the form looks like. 'The red stuff was added after the screen shot using Paint'

View 1 Replies

Regex - .NET: Manipulating TextBox Input: Dash Every 5 Characters And Removing Special Characters?

Dec 21, 2011

Essentially I am trying to replicate the Windows 7 (In-Windows) activation key TextBox form. The Form where it will auto capitalize letters, remove or deny all non alphanumeric characters except dashes every 5 characters that will be auto-input.I assume this can be done with a fairly complicated replacement Regular Expression but I cannot seem to create one to fit the needs.

This is an Example of what I have right now, but it creates an infinite loop as it removes all characters including dashes, than adds a dash, which changes the text and removes the dash again.

[Code]...

View 4 Replies

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

Using Substring - Remove "Left" And Use "Substring

Feb 3, 2011

I am trying to remove VB6 type code and use VB.Net code, in particular, remove "Left" and use "Substring". This code does not do what the old style code does. It seams to ignore the first two chars and forces the msgbox prompt no matter what I type in the textbox (at "Leave").

Private Sub TextBox5_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox5.Leave
If TextBox5.Text = "" Then
'Do nothing

[CODE]...

View 9 Replies

VS 2008 Hangman Project Part 1 - Display Form1.vb In Design View

Apr 3, 2011

2. Display Form1.vb in design view.

3. List the controls by the Name property and the control names, if any, that are not descriptive.

4. Change the Text property of the form to "Hangman."

5. Change the FormBorderStyle property to Fixed3D.

6. Explain why the form should not be resizable.

7. Change the Font of lblWord to Size 12 Bold.

8. Reposition lblWord so that its left edge is aligned with the left edge of the PictureBox picBody (the box in the center of the form).

9. Add code to the btnExit_Click event procedure to close the form, and exit the application by calling the form's Close method.

10. Add code to the btnNew_Click event procedure to:

[Code]...

View 17 Replies

Coding Hangman Program So That When Enter A Wrong Letter A Picturebox Image Would Appear Eachtime?

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

Game Programming :: Make A Game In VB In Which Character Can Move Around, Jump, And Kill Things?

Apr 2, 2008

im trying to make a game in visual basic in which your character can move around, jump, and kill things. I can get the picture box with the character to move and everything is fine. but i did run into one problem. when the character moves over a tree (or something) you can see the gray backround of the character as i made in paint. how do i make the backround of the picturebox transparent?

View 4 Replies

VS 2010 Game Multi-Client - Program That Enables A Game To Have More Than One Instance Running

Nov 18, 2011

I want to make a program that enables a game to have more than one instance running, where it would otherwise be unable to be done. How should I go about this? A sandbox? Hack?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved