Klaas Vredevort

Greenhorn
+ Follow
since Dec 27, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Klaas Vredevort

Hey guys

I have an Applet with a width of 500 and a height of 500 as well. i have an Image, jaspershangman.jpg, that I want to load to fit the entire window.



What can I do... I suppose it should be quite straightforward...

Thanks in advance!

Klaas
17 years ago
The Buttons can be found in init()

and I think the categories are quite straightforward. It asks for inputCategoryChoice and then it takes that to read the file. The files are called 1.txt, 2.txt etc
17 years ago
Hey guys

Listen I need some help. I have two classes, one an applet with RadioButtons in a panel. The other is a File Reader. It is a Hangman game with four files containing words. The user chooses a category from which the random word is called.

I want to link the RadioButton to the category. I will paste the code (both classes) entirely and then tell you at which line the category is called, as well as the RadioButtons.



And the rest...


17 years ago
Hey guys. I found this code: http://www.resultspk.net/hackirc/irchks-chp-9-sect-4.html

It's a trivia script for IRC. I would like to know how to change this script into regular IDE-based Java script. It already is in Java. It probably only needs minor changes...

What do you think?

Thanks

Klaas Vredevort
17 years ago
Thanks for the help in my previous post, guys... ive got it working! Good!

But now, how do i loop the sound file a few times? Can I specify the number of times?

Thanks!

Klaas

17 years ago
I dont understand. The program does compile, but no sound. Try any .au file on your side please... listen if you can hear it\

Thank you so much

Klaas
17 years ago
Hey guys!

Anyone have any idea why this program isnt running?

Thanks

Klaas

17 years ago
Hey

Is it possible to use two pictures in java and fade one into another? like the one slowly fading away and the next one fading to the foreground?

Klaas
17 years ago
Hey everyone. I'm sure everybody in here is getting sick and tired of me and my Hangman program. It's almost finished to a point that I can start using graphics.

This time, I'm doing things right!

The code in question is posted at http://pastebin.com/648264

The entire package so far is available for download (in case you want to compile it yourself to see what I'm talking about) at www.geocities.com/kitaarmykruis/Hangman.zip

OK, so here we go:

The program is a normal (so far!) IO-based Hangman program. We all know how that works. If a word is "hangman", the computer gives back "-------" and we have to guess the letters in the word. If we choose "a", the following is returned: "-a---a-" and if we choose "h": "ha---a-" until we get the word.

OK - so my program works like this: I've got three text files, 1.txt, 2.txt and 3.txt with different categories of words. The user selects a category and the word jumps up. (Or, well ----------!). If the user gets the word right, his/her score is added to, and this score is saved in a textfile, hangmanHighScore.txt, given that the user's score is higher than the previous high score.

If you check out the http://pastebin.com/648264 address quickly, look at line 17. It's basically the variable asking for the user's name and it is imported from HangmanFileReader, another .java file that I wrote (available at http://pastebin.com/648296 - the line that asks for the name is 32).

OK, so what now? Well, it reads the name, fine. But then, when you finish the word correctly, it asks you whether or not you want to play again. This poses two problems:

a) It doesn't write the new high score to the text file (the text file currently contains only one thing, the number <0>.

b) If you elect to play again, it again asks for your name. This isn't what I want. I want it to use the same name and continue with the score. It doesn't. It starts over completely.

What I've tried to do, as you can see in line 17 of the first page - is to read the name only once. The method nameInput reads the name from HangmanFileReader and returns playerName. playerName is then supposed to be taken from the method, but it says that the IOException needs to be thrown first.

Right: so I want your help with two things:

a) keeping track of the user's score and writing the high score to the text file.

b) using the player's name - asking for it only once.

Any help? Guys if I'm talking so that you can't understand, feel free to talk to me. I'll be in #Java on QuakeNet under the name georgestobbart for the next hour or so, so feel free to pop in. And again, if you want to compile the program yourself: www.geocities.com/kitaarmykruis/Hangman.zip you'll need to open Hangman, HangmanFileReader and HangmanManager (which acts like a driver).

Thanks!

Klaas
17 years ago
Hey

How do I create an array of unexpected symbols, e.g. @, $, ;, * etc in Java?

Also, can anyone tell me how to remove something like "(1956)" from a text file? I'm asking because what I am planning to do is create a Hangman program, and I'm using the names of movies I drag from Wikipedia, which some of them have dates in brackets behind them? Does anybody have an idea? I'd like to do them easily and painlessly - I'll paste a part of the file so that you guys can see what I mean.

Thanks in advance!

Klaas


King: a Filmed Record...Montgomery To Memphis
King Kong (1933)
King Kong (1976)
King Kong (2005)
King Kong vs Godzilla
King of Hearts
The King of Kings (1927)
King of Kings (1961)
The Kiss
Kiss Me Deadly
Kiss Me, Kate
17 years ago
I had my program edited by some guy, and he put in the following lines of code:



How come I have to add this.* to the bold lines? Everything else works just fine without it.

Klaas
18 years ago
Hey

I would like to know how to implement buttons instead of a manual input in the following program (I highlighted the part where the user puts in a letter of the alphabet so that you can see what I mean)


18 years ago
Hey!

I got a wonderful, though very crude, method to make Strings sleep in Java.
Mark Weber showed me the Thread.sleep() method. I love it! Can sombody please show me more examples of this? Or where can I find info on it?

Thanks!

Klaas
18 years ago
OK, I'm writing a Hangman program and it has three classes, Hangman, HangmanFileReader (it gets the words out of a file) and HangmanManager (which acts as a driver)

The program runs 100% the way I want it, except for one thing: If the user guesses a letter they have guessed correctly or incorrectly before, it still subtracts from their chances left.

What I want to do is add an array of chars, which contains the letters the user has already guessed. Then, if he guesses a letter he has guessed before, the computer says to that the letter has been used, and does not subtract it from the chances he has left.

I have declared the array as



in the Hangman class, which I will paste here. I certainly do not expect of you to go through the entire thing, but I think it should help you. Here is is:



What do you think? should it actually test for the letter before it does anything else?

Your help is greatly appreciated!

Klaas
18 years ago