thanks for ze help
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
thanks for ze help
Last edited by YouGoLast; May 30th, 2011 at 03:54 AM.
Sounds like you just need to come up with some good algorithms based on math that determine how many they want to take from the pile. Obviously they don't want to take the last one if it can be helped. I think a lot of if statements would be the way to go. if (2 stones in pile 3 remain && pile 1 && pile 2 are empty) take 1 etc. =/ it doesn't really seem to be that much of a strategic game so I don't know how much you could really do.
I think understanding the math behind the game will definitely help you create an AI which will always win (if it can). This game is also known as Nim.
For a mathematical approach to always winning, see Nim - Wikipedia
Programming AI for a simple game is a great project to explore. If you’re interested in working with AI, especially for text-based outputs or game dialogue, you might find AI text generators helpful. This guide on an <a href="https://www.sembly.ai/blog/top-ai-text-generators/">artificial intelligence text generator</a> provides insights into some of the best tools available, which could be useful for your game development process.