Game of Mastermind Programming Software Development by oceanaut …for two players, i.e., a codemaker and a codebreaker, invented in 1970 by Mordecai Meirowitz. The codemaker …, green, blue, black, yellow}, with duplicates allowed. The codebreaker tries to guess the colors as well as the positions…in the secret code. For each guess that the codebreaker makes, the codemaker provides feedback in the following form… MasterMind project Due 12/14/10 Programming Software Development by ProgrammerAl …becomes the codemaker (the program), the other the codebreaker (the player). The codemaker randomly chooses a pattern …visible to the codemaker but not to the codebreaker. The codebreaker tries to guess the pattern, in both …guesses and feedback continue to alternate until either the codebreaker guesses correctly, or ten incorrect guesses are made… Mastermind game(using Bayesian approach) not sure if this is how i would approach it Programming Software Development by lotrsimp12345 … score?. An event is defined as a row that the codebreaker uses. Re: Game of Mastermind Programming Software Development by iamthwee Post what you have done so far... Re: Game of Mastermind Programming Software Development by Majestics Only help No homeworks doing forum. Re: Game of Mastermind Programming Software Development by medoyem could U plz show me what have u done and how did u do this game for more experience?? waiting for ur reply Re: Game of Mastermind Programming Software Development by oceanaut [code=c] #include <stdio.h> #include <stdlib.h> #include <time.h> #define false 0 #define true 1 typedef struct{ int colors[4]; int black; int white; } guess; void valuation(int *col1, int *col2, int *wp, int *bp) { int color[6][2]; int c; int white; int black; for(c=0; c<6; c++) … Re: Game of Mastermind Programming Software Development by jephthah use [code=c] tags, please Re: Game of Mastermind Programming Software Development by medoyem Thanks alot for ur reply,,,,,but when I tried to run this code a 38 errors have occured Re: Game of Mastermind Programming Software Development by medoyem > use code tags, please In which line should I write these code tags. Re: Game of Mastermind Programming Software Development by jephthah [QUOTE]Thanks alot for ur reply,,,,,but when I tried to run this code a 38 errors have occured[/QUOTE] so what it seems to me that you're saying, is that you don't understand anything about the code you posted because, i assume, you copied it from someone/somewhere else? if i'm wrong, then accept my apologies, and continue by explaining … Re: Game of Mastermind Programming Software Development by medoyem Thanks for ur reply,,, really I understand the task but when I tried to check the performance for this code by using Microsoft visual c++, I descovered 38 errors, when I come to see and fix these errors, i found alot of them are undefined identifier like the word again in the last of the code, and when i checked the code it was already declared in… Re: Game of Mastermind Programming Software Development by jephthah what does what mean? . Re: Game of Mastermind Programming Software Development by medoyem see I read this code and got what the program is ok,,,,,then when I printed this code to the Microsoft visual c++ 6.0, I found 38 silly errors, like semicolon, and declaration variables where there are already declared, I tried to use another program to see the output of this code by using code blokcs (another program), I found that when I run it … Re: Game of Mastermind Programming Software Development by jephthah [b]medoyem [/b] i just realized you are not the original poster. i made a mistake. sorry for the confusion. [b]oceanaut[/b] you cant just throw a few hundred lines of code out and hope Giapetto's elves come along and fix it for you. what is your problem with the code? besides the 38 silly errors as mdoyem pointed out. perhaps you … Re: MasterMind project Due 12/14/10 Programming Software Development by ProgrammerAl Here's some code I've worked on so far, My problem so far is figuring out why its only building one Panel when I want eight panels in the CENTER. Classes: MasterMind - Launcer Interface - Screen MasterMind Code [CODE] package masterMind; public class MasterMind { public static void main (String[] args) { Interface run… Re: MasterMind project Due 12/14/10 Programming Software Development by adams161 A little confusing for me. I would create one master panel for the JFrame and add it to frame. From then on i would add additional panels to the master panel. I would give the master panel some layout maybe border layout. I would add one panel to the center of the master panel. I would give this panel i add to the center an 8 by 4 grid … Re: MasterMind project Due 12/14/10 Programming Software Development by mrnutty I did this for my university like 3 years ago. The exact same problem. I still have it, for a price. Re: MasterMind project Due 12/14/10 Programming Software Development by adams161 Looking at your original post, i would have the center 8 by 4 grid be for display. I would make one panel for the center and would add two panels to it that sit left to right. one 8 by 4 ( show their guesses) and next to it an 8 by 1 which you add 8 panels of (2by2) for guess pegs. Input could just be a text box. type R G B B hit enter ( need … Re: MasterMind project Due 12/14/10 Programming Software Development by adams161 you might simply make it 8 by 5 with the 5 collum having a panel that has a 2 by 2 grid layout and 4 guess peg buttons added. this 5th area would be the same size as guesses making the 4 pegs 1/4 the size of a guess button. color then white and black. Mike Re: MasterMind project Due 12/14/10 Programming Software Development by ProgrammerAl Adam first, I would like to thank you for saying something about how the interface will mess up without proper gridlayout for that was exactly my problem. Secondly, sorry for confusing you Adam, maybe this will be more simple now that I commented on my code. [CODE]package masterMind; import java.awt.BorderLayout; import java.awt.GridLayout;… Re: MasterMind project Due 12/14/10 Programming Software Development by ProgrammerAl I tried making 32 Buttons on one Panel. All buttons just line up next to each other. Is there a way to put a Gridlayout into a panel? [CODE] public void buildChoicePanel() { choiceButton = new JButton[NUM_CBUTTONS]; for(int i=0; i<NUM_CBUTTONS; i++) { choiceButton[i] = new JButton(""+i); } choicePanel = new … Re: MasterMind project Due 12/14/10 Programming Software Development by adams161 you are setting the layout twice in the interface constructor. the interface constructor is a frame. I don't even know if a frame can have a layout or how that works. I always do [code=java] class myframe extends JFrame { myframe() { mypanel panel = new mypanel(); add(mypanel)// the single panel i add to frame. every other panel control is … Re: MasterMind project Due 12/14/10 Programming Software Development by ProgrammerAl That's actually pretty much what I use to do too. The reason why I'm trying this is because I'm looking over some demo code she did, and I was trying to follow that but I think I shouldn't follow a demo code cause it is what it is... a demo. Perhaps you could explain what my professor did? [CODE]package RadioButtons; import javax.swing.*; import… Re: MasterMind project Due 12/14/10 Programming Software Development by ProgrammerAl So, I created a new class for my panels and added it to my JFrame class.. Problem is I can't get the layout to look the way I want it to. Class extending JFrame [CODE] package masterMind; import java.awt.BorderLayout; import java.awt.GridLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; public class … Re: MasterMind project Due 12/14/10 Programming Software Development by jon.kiparsky [CODE]setLayout(new GridLayout(8,8)); //!PROBLEM! The Gridlayout just doesn't layout the buttons the way I want to // the way i want it to look is 8 rows 4 columns [/CODE] Surely GridLayout(8,8) returns 8 rows, 8 columns? Unless you're skipping some columns, this might be your problem. Maybe this is in your code - if it is, I'm sorry, … Re: MasterMind project Due 12/14/10 Programming Software Development by adams161 hopefully that was a typo [code=java] add(p BorderLayout.CENTER); [/code] my recollection is there is a comma between p and BorderLayout.CENTER Mike Re: MasterMind project Due 12/14/10 Programming Software Development by ProgrammerAl Thanks adam that helped.[QUOTE]Surely GridLayout(8,8) returns 8 rows, 8 columns? Unless you're skipping some columns, this might be your problem[/QUOTE] Hmm even tho the gridlayout is (8,8) It would just build into that format then leave the rest blank. Though I tested (8,4) it still didn't work. I still have the problem where the program is just … Re: MasterMind project Due 12/14/10 Programming Software Development by adams161 let's just look at this: [code=java] public void buildChoicePanel() { setLayout(new GridLayout(8,4)); // this seems to apply to whatever panel is calling this method. //!PROBLEM! The Gridlayout just doesn't layout the buttons the way I want to // the way i want it to look is 8 rows 4 columns choiceButton = new JButton[NUM_CBUTTONS]; for (int… Re: MasterMind project Due 12/14/10 Programming Software Development by ProgrammerAl Adam how do i upgrade your reputation here.. because that fixed everything. I have to admit I failed to truly understand chapter 7 due to personal issues but I only blame myself.I simply thought you had to put it out there it will organize it. Ok so am I doing the borderlayout correctly in the JFrame class? *EDIT* I remember you saying you're not …