View Single Post
Old Apr 13th, 2008, 10:32 AM   #10
kewlgeye
Programmer
 
Join Date: Jan 2008
Posts: 54
Rep Power: 1 kewlgeye is on a distinguished road
Smile Re: Random "Letter" Generator

Quote:
Originally Posted by manny85 View Post
Side note: Kewlgeye, are you trying to generate two separate random values meaning a random letter and a separate random number? In my code above I'm using the randomly generated number to retrieve the corresponding letter. So if a user inputs either the correct number or letter they win (1 or A, 2 or B, 3 or C, ... , 10 or J).

I am trying to pull up a window that allows a user to enter a number or a letter between 1-10 or A-J and depending on what they choose, the program will generate a random number or letter depending on the users first input.

The user types A a new window pops up and asks you to guess a letter between A-J and you have 3 trys, if you enter z or a lowercase then you receive an error window.

If the user enters 2 in the first window then you are taken to a new window that asks you to guess a number between 1-10 and you have 3 trys, likewise, if you enter 20 you will receive an invalid number error in a window, otherwise the program terminates with a window that says "Sorry you had three tries, the number or letter was "?" <------- whatever the number or letter was, but it should not display both random number or letter, just the one that you were guessing on.


Thank you all for your help and recommendations on this.

Manny, I tried your program and it works great, it should just show the letter or number though, and the letters are ok, but the numbers are 1 behind, meaning that if the actual number to be guessed is 4 I should enter a 5 in order to get it correct. But way to go, the program itself works. Nice job!
kewlgeye is offline   Reply With Quote