Results 1 to 20 of 21
Thread: High-Low Game
- 08-11-2012, 04:31 PM #1
Member
- Join Date
- Feb 2012
- Posts
- 54
- Rep Power
- 0
High-Low Game
I am trying to create a game hopefully with a graphics interface. The game will be like the high-low card game with a graphics interface where a card is shown and the user has to select either higher or lower, and if they are wrong the game ends and gives the options to either exit or start a new game.
What I aim to do:
\\Create a graphics interface
\\Create basic code
\\Create user-input prior to graphics interface
I want to start off by creating a simple program that I can run in command prompt and I will be able to input either high or low and other basic functionality's will also work. What I am trying to find out is how I can either give the user options to choose or ask the user a question and when an answer is in-putted it responds appropriately doing what is asked or by asking for another input. Could anyone help enlighten me with how I can allow a user input?
- 08-11-2012, 04:51 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
Re: High-Low Game
Have you read about the Scanner class?
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 08-11-2012, 04:54 PM #3
Member
- Join Date
- Feb 2012
- Posts
- 54
- Rep Power
- 0
- 08-11-2012, 05:10 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
- 08-11-2012, 07:16 PM #5
Member
- Join Date
- Feb 2012
- Posts
- 54
- Rep Power
- 0
Re: High-Low Game
I have had a look at the Scanner class but I am not fully understand in what way I am suppose to use it, I am relatively new to java and the large amount of code that they use in the really big index to give examples with I am not able to fully understand and learn to use in creating what I am trying to make.
- 08-11-2012, 09:01 PM #6
Re: High-Low Game
From the Really Big Index: Scanning (The Java™ Tutorials > Essential Classes > Basic I/O)
If you consider this a "large amount of code", then I'm sorry... programming is not for you.Get in the habit of using standard Java naming conventions!
- 08-11-2012, 10:03 PM #7
Member
- Join Date
- Feb 2012
- Posts
- 54
- Rep Power
- 0
Re: High-Low Game
You forget I am a beginner and that amount of code easily confuses as I am not used to having so many unknowns shown to me at once.
- 08-11-2012, 10:29 PM #8
Re: High-Low Game
Then start with the "Hello World" example and work through each example in order so there is only one new concept at a time.
Get in the habit of using standard Java naming conventions!
- 08-12-2012, 02:07 AM #9
Member
- Join Date
- Feb 2012
- Posts
- 54
- Rep Power
- 0
- 08-12-2012, 03:00 AM #10
Student
- Join Date
- Jul 2012
- Location
- United States
- Posts
- 328
- Rep Power
- 1
Re: High-Low Game
"Success is not final, failure is not fatal: it is the courage to continue that counts." - Winston Churchill
- 08-12-2012, 03:05 AM #11
Re: High-Low Game
You've asked two kinds of questions here: very simple beginner questions that you don't even understand the answer to when people like Norm try to talk you through it; and very advanced, broad, and vague questions like this one. If you refuse to take things step by step between whatever you do understand and the things you're asking about, then basically you're just asking people to write your program for you. And nobody wants to do that.
Get in the habit of using standard Java naming conventions!
- 08-12-2012, 04:15 PM #12
Member
- Join Date
- Feb 2012
- Posts
- 54
- Rep Power
- 0
Re: High-Low Game
If I am to learn the scanner class is it absolutely necessary for me to learn every page prior to it in the RBI?
- 08-12-2012, 04:24 PM #13
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
Re: High-Low Game
Not really, because the RBI mentions all tutorials (that's why it's really big). There is a paragraph about basic IO where the Scanner class is mentioned; that'd be a good starting point. If that paragraph mentions stuff you have never heard about or you don't understand, look in the RBI again.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 08-12-2012, 04:32 PM #14
Member
- Join Date
- Feb 2012
- Posts
- 54
- Rep Power
- 0
Re: High-Low Game
Thanks, I will take a look at that when I get chance.
- 08-14-2012, 04:35 PM #15
Member
- Join Date
- Feb 2012
- Posts
- 54
- Rep Power
- 0
Re: High-Low Game
I have been looking over the scanner class repeatedly and I am seeing a way for it to print an output of a file with a specified separator but I am not understanding how to use it to help with user input. Am I missing something really obvious?
- 08-14-2012, 04:58 PM #16
Re: High-Low Game
Yeah,
Java Code://... Scanner userInput = new Scanner(System.in); int num = userInput.nextInt(); //...
- 08-14-2012, 05:51 PM #17
Re: High-Low Game
The Scanner class doesn't have the ability to print anything. Are you trolling us?
Get in the habit of using standard Java naming conventions!
- 08-14-2012, 05:53 PM #18
Member
- Join Date
- Feb 2012
- Posts
- 54
- Rep Power
- 0
- 08-14-2012, 06:10 PM #19
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: High-Low Game
That's what the program does that is using Scanner.
The Scanner doesn't print the words on different lines, it simply reads each token (word) from the file.Please do not ask for code as refusal often offends.
- 08-14-2012, 06:13 PM #20
Member
- Join Date
- Feb 2012
- Posts
- 54
- Rep Power
- 0
Similar Threads
-
High and Low Game using limited resource
By xcaldk74 in forum New To JavaReplies: 12Last Post: 02-29-2012, 08:38 PM -
problem with high low game
By zlass in forum New To JavaReplies: 2Last Post: 12-03-2011, 08:51 PM -
High Quality .....
By farzana shamim in forum Forum LobbyReplies: 1Last Post: 07-22-2009, 02:43 PM -
sample of guess high and low game
By pouria62 in forum AWT / SwingReplies: 1Last Post: 10-26-2008, 12:57 PM -
High BW sites
By Sarinam in forum NetworkingReplies: 2Last Post: 06-16-2008, 02:38 PM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks