Computer Science Canada Mastermind V1.0 |
Author: | S_Grimm [ Tue Dec 09, 2008 6:58 pm ] | ||
Post subject: | Mastermind V1.0 | ||
So...... Mastermind. For those of you who don't know what it is, it is a game where you guess the numbers. This version is a four number version. (as in guess 4 numbers ie 8862 or 1497). I would love suggestions on how to improve the code. Next Version to include: GUI interface. Instead of numbers, colors! BTW: If anyone in my class (rto) takes this and submits it as there own......
|
Author: | Tony [ Tue Dec 09, 2008 7:06 pm ] | ||
Post subject: | RE:Mastermind V1.0 | ||
You have a lot of repeating code. Instead of
where each block has a redundant block of code, you can iterate over the conditions with a for-loop. Same goes for your 4 copies of the "for (int i = 0 ; i < 4 ; i++)" loops. |
Author: | S_Grimm [ Tue Dec 09, 2008 7:22 pm ] |
Post subject: | RE:Mastermind V1.0 |
the "for (int i = 0; i < 4; i++){}" loops are separate so that they individually check. Stupid way to do it, I know, but it works. The "if masterChar..." stuff I will change though. |
Author: | Tony [ Tue Dec 09, 2008 7:26 pm ] | ||
Post subject: | RE:Mastermind V1.0 | ||
no? |
Author: | S_Grimm [ Tue Dec 09, 2008 7:35 pm ] | ||
Post subject: | RE:Mastermind V1.0 | ||
lol. I am reaaaally stupid. thanks tony. What did that just cut out? ummm.. 57. wow. Just wow. Thanks Tony. Heres the updated copy
|
Author: | S_Grimm [ Tue Dec 09, 2008 7:36 pm ] |
Post subject: | RE:Mastermind V1.0 |
Actually, I don't think that i need the boolean statements either....... edit. Nvrmind i do need them. Anyone have any other suggestions? |
Author: | rto [ Wed Dec 17, 2008 9:10 am ] |
Post subject: | RE:Mastermind V1.0 |
God this program is completely and utterly garbage -.- haha jk, goodly done |
Author: | S_Grimm [ Wed Dec 17, 2008 11:19 am ] |
Post subject: | RE:Mastermind V1.0 |
Well considering MINE is completed AND handed in to the teacher and YOURS still isn't.......... I'd say mine is better than yours. jk. |