My first game - Digits

[applet archive=digits4k.jar class=KidAgainGames.Digits4K width=600 height=600]

My favorite electronic game as a kid. Let’s see if I posted this correctly.

Click the game to focus.

Enter a 3, 4, or 5 digit number and press enter.
The game will remember how many digits you entered and show you how many digits are correct and how many digits are in the correct sequence.
Enter your next guess, same number of digits, but don’t hit enter.
Keep guessing, using deductive reasoning, until you guess the number.
When you guess the correct number, the display will start flashing.
Hit ‘R’ to reset the game at any time.

Have Fun

Posted in the Java4K contest http://java4k.com/index.php?action=games&method=view&gid=381

For some reason, it doesn’t load. Decline the permission and click on the link to Java4K.

In the applet tag you refered to “Digits4K.jar” while it should be “digits4k.jar”.
(see: http://user-generated-content.java-gaming.org/members/67899/)

Working now, thank you Riven

then you may want to change again, cause I got SecurityException: Permission Denied.

You compiled your code under Java7.

Everybody with a Java6 plugin will get this:

Unsupported major.minor version 51.0

Yes, but I set the compiler target to 1.6.

Apparently not :slight_smile:

OK, just recompiled and ran it with JRE6.
I’ve uploaded the new file, please tell me if it works with 1.6 plugins.

I downloaded the JAR, extracted it, opened the file in a hex-editor and it said “0x33” (which is 51)

In short: it’s still Java7.

OK, thank you Riven. I don’t how you did that, but I’ll have to research eclipse and find out why when I set the target to 1.6, it still generates 1.7.

To verify it yourself, download this tool: http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm

I appreciate your help Riven.

The file I have on my computer has the CAFEBABE followed by 00 00 00 32.

I tried to delete the file from MyFiles, and then upload the new one.
Apparently, it’s keeping the old one.

That’s not quite possible. In the [My Files] listing, you see which files are on disk on the server, in your directory. If you delete ‘digits4k.jar’ and upon refreshing the page, it doesn’t show up, it means it is properly deleted. If you upload your ‘digits4k.jar’ and it seems like the old file, you may have uploaded the wrong file (as in: you have another digits4k.jar on your harddrive that is outdated).

Edit:
I just checked and it has version 50.0 now. The applet works correctly!

Sorry for all the confusion, and thank you for verifying this for me.
It is greatly appreciated.

No problem.

Could you tell me what you did to fix it?

If you mean how did I make it compile for 1.6 when all I have is JDK 1.7 …

I’m using Eclipse Indigo as my IDE.
Under Project->Properties->Java Compiler I checked the “Enable project specific settings”.
There is a drop list for “compiler compliance level”, which I changed to 1.6
This also changes the “generated .class files compatibility” to 1.6

Then I clicked “Apply” and OK.
I have auto-build enabled so after the dialog closes the project is re-built.

For command line people, the option for javac is -target [release]

I know how to do that in Eclipse :wink:

I thought there was another problem, as your posts seemed to suggest that something else was wrong.

Well, enough offtopic rambling: congrats with your first game!

Have you updated one at java4k? because it still tells me to install java.

yes, the same version that Riven confirmed here is also at Java4K.

I’ve noticed there is a download count at Java4K, but I can’t find
a download button anywhere so I can verify the jar file is correct.

This has me baffled, I’ve only got one copy of the jar file on my computer,
so the two files should be identical.