Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (542)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (605)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  MasterMind  (Read 6603 times)
0 Members and 1 Guest are viewing this topic.
Offline ra4king

JGO Kernel


Medals: 356
Projects: 3
Exp: 5 years


I'm the King!


« Posted 2011-07-15 02:02:02 »

Well I had some free time and my mom gave me the idea of making MasterMind!

Some screenshots:






[size=20pt]PLAY!![/size]

Rules and procedures:
This is a guessing and logic game.
There are 4 unique colors hidden. Your job is to guess them correctly. After you choose your 4 colors, you click on the arrow for that row to be evaluated. The 4 small holes on the right side are the results and they show how close to the right answer you were. A black hole means 1 of the 4 colors is placed in the correct spot. A white hole means 1 of the 4 colors is included in the answer but is not placed in the correct spot. The results are filled in no particular order. You win when you correctly guess all 4 colors. You lose when you cannot guess after 10 turns.
When you win, the results will show 1 blue hole.

How to play:
To place colors, you click on the desired color and then click on the desired hole.

Offline ReBirth
« Reply #1 - Posted 2011-07-16 04:50:17 »

Straight to some suggestions:
-automatic check after all four circles filled (no need arrow button)
-More colors, 4 out 6 is kinda easy Cool

And there is lag when I change color. That's all. Cheers Smiley

Offline Swattkidd7

Junior Devvie





« Reply #2 - Posted 2011-07-16 06:03:35 »

This was a fun little game, although it would be nice if the colors moved down with you, its a bit of a pain to have to go all the way up to change the color Tongue

Straight to some suggestions:
-automatic check after all four circles filled (no need arrow button)

And there is lag when I change color. That's all. Cheers Smiley

I didnt get any lag, but I dont think an automatic check would be that great, in case you misplace something.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ra4king

JGO Kernel


Medals: 356
Projects: 3
Exp: 5 years


I'm the King!


« Reply #3 - Posted 2011-07-16 08:09:48 »

Straight to some suggestions:
1-automatic check after all four circles filled (no need arrow button)
2-More colors, 4 out 6 is kinda easy Cool

3-And there is lag when I change color. That's all. Cheers Smiley
1. Automatic check won't allow you to look over what you have placed. Too many times do I place a couple colors, look over everything, notice I did something wrong, and hit the "clear" button.
2. This game was not invented by me, but it is actually an old classic. I may just add more colors for the fun of it but it would make MUCH harder.
3. I don't notice a lag O_o

This was a fun little game, although it would be nice if the colors moved down with you, its a bit of a pain to have to go all the way up to change the color Tongue
Great suggestion! I don't like the way it's set up now either but I couldn't think of anything better Tongue
I'll implement that and update it.

Thanks for playing!

EDIT: Here is a picture of the MasterMind board that I have:

Offline ReBirth
« Reply #4 - Posted 2011-07-17 04:17:57 »

Straight to some suggestions:
1-automatic check after all four circles filled (no need arrow button)
2-More colors, 4 out 6 is kinda easy Cool

3-And there is lag when I change color. That's all. Cheers Smiley
1. Automatic check won't allow you to look over what you have placed. Too many times do I place a couple colors, look over everything, notice I did something wrong, and hit the "clear" button.
2. This game was not invented by me, but it is actually an old classic. I may just add more colors for the fun of it but it would make MUCH harder.
3. I don't notice a lag O_o
1. you may right.
2. you can add a level chooser.
3. yeah it did. Firefox 3.6.15 Win XP 1GHz 384MB.
4. I just noticed that the JOptionPane is kinda different to usual Swing's. It has glassy aero theme. But how?

Offline ra4king

JGO Kernel


Medals: 356
Projects: 3
Exp: 5 years


I'm the King!


« Reply #5 - Posted 2011-07-17 05:47:17 »

...
2. you can add a level chooser.
3. yeah it did. Firefox 3.6.15 Win XP 1GHz 384MB.
4. I just noticed that the JOptionPane is kinda different to usual Swing's. It has glassy aero theme. But how?
2. Good idea!
3. 384MB RAM?!? O_O Well there is nothing in the color choosing code other than doing color.contains(point).
4. It's called the Nimbus Look and Feel. The default LAF (that you're used to) is the Ocean (Metal) Look and Feel. This LAF is not in the public API but you can access it by doing:
1  
2  
3  
4  
5  
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");

or

UIManager.setLookAndFeel(new com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel());

Offline Trosters

Junior Devvie


Projects: 1



« Reply #6 - Posted 2011-07-17 19:37:41 »

pretty fun game!:D I remember playing it when I was little, it was a great deal of fun!:) I didn't read your entire post so I had trouble understanding what the different color small circles meant, I thought white ones meant they were correct and black ones that they failed!:/
Offline ReBirth
« Reply #7 - Posted 2011-07-17 22:32:08 »

@r4king
oh crap why they need to put such long name to access that theme lol
you now, it's so hard to find $2 DDR1 PC2700 RAM so I could add a bit from 256MB. If a game run smoothly in my pc, it should be too much performance-friendly Smiley

Offline loom_weaver

JGO Coder


Medals: 17



« Reply #8 - Posted 2011-07-17 23:16:06 »

If I'm not mistaken, the player hiding the pegs can also use more than one peg of the same colour.

For example they can use:
*green* *green* *green* *black*

Game seemed to work good for me.  However when you win it should unveil the hidden pegs.
Offline luisoft

JGO Coder


Projects: 6


Java games rock!


« Reply #9 - Posted 2011-07-18 00:01:30 »

I did one for java 4k 2005 competition:

http://www.java4k.com/index.php?action=games&method=view&gid=24



Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ReBirth
« Reply #10 - Posted 2011-07-18 00:03:41 »

It looks like that you shouldn't be showed the hidden pegs since you won it afterall Cheesy

Offline ra4king

JGO Kernel


Medals: 356
Projects: 3
Exp: 5 years


I'm the King!


« Reply #11 - Posted 2011-07-18 03:46:19 »

If I'm not mistaken, the player hiding the pegs can also use more than one peg of the same colour.

For example they can use:
*green* *green* *green* *black*

Game seemed to work good for me.  However when you win it should unveil the hidden pegs.
But that would make it 500x harder!
And there would be no logic, just guessing.

Oh and it does unveil the hidden pegs. Right before the dialog box pops up.

Offline Bonbon-Chan

JGO Coder


Medals: 12



« Reply #12 - Posted 2011-07-18 09:26:27 »

In the original MasterMind, you can have several time the same color (which is more harder).
Offline philfrei
« Reply #13 - Posted 2011-07-19 07:02:40 »

Nice! Played real smooth. No complaints, except the distance travelled keeps increasing.

A couple ideas for that: Allow a click on a color of the previous row? Allow one to click the spot multiple times and have this rotate through the colors? A popup palette you can move around? Allow drag-and-drop?

A good friend of mine used to play a game called ... omigod, I've forgotten it. It will come to me. It was a word-version of Mastermind. Each player picks a five-letter word, and they take turns making five-letter word guesses until they get it. We worked through some basic strategies like coming up with four five-letter words with no duplicate letters (used as a kind of elimination strategy). If I recall correctly, we eventually got good enough where just 5 or 6 guesses was often enough, and we'd spend a lot of time trying to come up with stumper words (glyph, aerie, queue, miaou, xylem), especially if you had a good notion of the strategy the other was using. (Example: if you know they are using an elim strategy and know their favorite wordset, pick one letter from each word in the word you make up. Then, the info they get from the four guesses is nearly worthless.)

Games could take as long as 40 - 50 minutes (for a single game). Nerds! Grin We used a LOT of scratch paper working on the logic.

But yeah, there definitely ARE strategies for dealing with Mastermind rounds with multiples having the same color! It's hard but it is not random. Elimination strategies can work as there because it is easier to put up a guess with zero matches (very useful info).

Dang, I'm going to have to write my friend and ask him the name. Or, I'll awaken at 4AM with it and add it here via an edit.

JOTTO! That was the name. (But unlike the wiki description, we gave scores for both exact hits and matches hitting letters that were out of place.)

Check out the wikipedia listing. Knuth had an algorithm to solve it, even with the duplicate pegs, in 5 or 6 turns!
http://en.wikipedia.org/wiki/Mastermind_(board_game)
It looks similar to what I was trying to do in Jotto.

"It's after the end of the world! Don't you know that yet?"
Offline ra4king

JGO Kernel


Medals: 356
Projects: 3
Exp: 5 years


I'm the King!


« Reply #14 - Posted 2011-07-19 10:15:11 »

Nice! Played real smooth. No complaints, except the distance travelled keeps increasing.

A couple ideas for that: Allow a click on a color of the previous row? Allow one to click the spot multiple times and have this rotate through the colors? A popup palette you can move around? Allow drag-and-drop?

A good friend of mine used to play a game called ... omigod, I've forgotten it. It will come to me. It was a word-version of Mastermind. Each player picks a five-letter word, and they take turns making five-letter word guesses until they get it. We worked through some basic strategies like coming up with four five-letter words with no duplicate letters (used as a kind of elimination strategy). If I recall correctly, we eventually got good enough where just 5 or 6 guesses was often enough, and we'd spend a lot of time trying to come up with stumper words (glyph, aerie, queue, miaou, xylem), especially if you had a good notion of the strategy the other was using. (Example: if you know they are using an elim strategy and know their favorite wordset, pick one letter from each word in the word you make up. Then, the info they get from the four guesses is nearly worthless.)

Games could take as long as 40 - 50 minutes (for a single game). Nerds! Grin We used a LOT of scratch paper working on the logic.

But yeah, there definitely ARE strategies for dealing with Mastermind rounds with multiples having the same color! It's hard but it is not random. Elimination strategies can work as there because it is easier to put up a guess with zero matches (very useful info).

Dang, I'm going to have to write my friend and ask him the name. Or, I'll awaken at 4AM with it and add it here via an edit.

JOTTO! That was the name. (But unlike the wiki description, we gave scores for both exact hits and matches hitting letters that were out of place.)

Check out the wikipedia listing. Knuth had an algorithm to solve it, even with the duplicate pegs, in 5 or 6 turns!
http://en.wikipedia.org/wiki/Mastermind_(board_game)
It looks similar to what I was trying to do in Jotto.
Thanks for playing! I shall get around to implementing Swattkidd7's suggestion of the palette moving down with you!

Jotto sounds amazingly hard, with all the number of possible 5 letter words!

And all those algorithms make my head hurt Shocked

Offline ra4king

JGO Kernel


Medals: 356
Projects: 3
Exp: 5 years


I'm the King!


« Reply #15 - Posted 2011-07-21 12:16:59 »

I have updated the game making the color chooser go down with you, and I have added the ability to right click to change the current selected color.

Offline Apo
« Reply #16 - Posted 2011-07-22 13:09:56 »

Works fine but a little help would be great. I've to read the thread to understand what the white or black dots means.

Suggestions:
- add more colors
- allow to set the same color several times
- perhaps a menu
Offline ra4king

JGO Kernel


Medals: 356
Projects: 3
Exp: 5 years


I'm the King!


« Reply #17 - Posted 2011-07-23 05:20:30 »

Works fine but a little help would be great. I've to read the thread to understand what the white or black dots means.

Suggestions:
1- add more colors
2- allow to set the same color several times
3- perhaps a menu
Yeah I should really add an "Instructions" screen :S

1. Yes sir!
2. *sob* finneeeeee
3. A menu for what?

Offline h3ckboy

JGO Coder


Medals: 5



« Reply #18 - Posted 2011-07-23 10:03:10 »

well, in said menu you could have difficulty option, so that the people who want more colors are satisfied....
Offline ra4king

JGO Kernel


Medals: 356
Projects: 3
Exp: 5 years


I'm the King!


« Reply #19 - Posted 2011-07-23 10:23:57 »

well, in said menu you could have difficulty option, so that the people who want more colors are satisfied....
Good idea....since I have a Menus framework, this could be very easily implemented.

Pages: [1]
  ignore  |  Print  
 
 

 
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!