This site requires JavaScript, please enable it in your browser!
Greenfoot back

mjrb4's Comments

Back to mjrb4's profile

Just to make it clear, beacuse I didn't state it above - new classes are perfectly fine :)
A little more detail... This challenge probably ISN'T the best if you've just started out programming. If you're still getting to grips with the basics, then I'd recommend trying mik's breakout challenge that was posted a few weeks ago, or something similar to that. That said, the challenge here is all about creating and working out the algorithm to create a flawless naughts and crosses player, so you don't have to be a wizard at Java - even if you've come from another programming background and haven't been coding in Java that long, you might still be able to crack this one :) So where do you start? Apart from the obvious (downloading the source) you've got a class (AI) you can modify in any way you like - as long as you don't circumvent the rules and play unfairly! There are also 2 methods in the Grid class that you will need to use - the first one, move, is what you call to place a naught in a square. That's pretty essential to actually do anything! The second, getDescription(), returns a 3x3 array of strings, each representing a different cell and each containing a description of that cell. Apart from that, all the coding is down to you! You've got to first find out a method to win all the time (Google will help you with that - there's plenty of sites out there that explain how) and then you've got to convert that method into a Java algorithm. If a few people take this up, it'd be really interesting to see the differences in how you approached / solved the problem, so feel free to post solutions! Good luck!
mjrb4mjrb4

2008/7/31

Click and drag :)
Nice! Took me a while to get the hang of it, but a fun game :)
No problem :) The numeric box sounds like a good idea. Another thing in general for the text box, I think it'd be good to just allow characters - i.e. things like the arrow keys and function keys could get filtered out.
mjrb4mjrb4

2008/7/22

Sounds now added.
From a practical point (sound wise) if you upload the source and explain your problem, someone (might even be me) could explain what you're doing wrong on the sound front.
Nice! Looks like a really good start to something here, and the menus work really well. Couple of improvement suggestions if you're interested - how about a timer? You could turn it into an actual game where you have to answer as many questions as you can in the specified time, then get a score at the end of it all. Also, I hit enter by accident a couple of times and it said 0 wasn't the correct answer - fair enough, it wasn't, but it'd be nice to have something that said you can't give an answer before you've typed any number? It'd also be good to stop anyone typing letters at all :) Then there's the obvious things about other problems. Addition and multiplication - the next logical step sounds like implicit differentiation to me! Oh ok. Perhaps there's subtraction first. Good start though :)
Nice idea! I did find it practically impossible though... Might just be me :)