Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Mastermind
Index -> Programming, Java -> Java Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
np_123




PostPosted: Wed Jun 15, 2016 11:44 am   Post subject: Mastermind

Mastermind (single-player) code-guessing board game

Mechanics:
Code is randomly generated. The code can have repeated colours.
To make a guess, select colours from the six colour squares on the right, then click on a circle to make it that colour. If the circle already has a colour, it will be replaced. Empty (no colour) circles are not allowed, therefore all circles must be given a colour before submitting a guess.
If you do not find the code in 12 guesses then it will revealed to you in the row coloured orange (at the very top).

Score:
A grid of 6 circles will be displayed beside your guess (after you submit it).
White circle means correct colour, but wrong spot. Red circle means correct colour and correct spot.

For example, you submit a guess with 6 green and it shows 1 red circle and 5 black(default), then you know there is only 1 green in the code. But it could be anywhere.

Let me know if you experience any bugs.
If you look at source code, it follows MVC model. I was a bit lazy with commenting though.



Mastermind.zip
 Description:
runnable jar (as well as source and makefile)
*makefile is for creating jar, not compiling.

Download
 Filename:  Mastermind.zip
 Filesize:  32.65 KB
 Downloaded:  244 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Java -> Java Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: