Hello,
I'm writing a project for school (C#), and I could use some help :-)
I need the computer to be able to solve a whole link-a-pix game board by itself.
Basically, I need a function that can find possible connections between two numbers on a board, when there are certain limitations, several possible connections and only one of the numbers is given (the second could be one of several others).
Can you help me?
Thanks,
Noa
2 replies to this topic
#1
Posted 11 April 2011 - 06:19 AM
|
|
|
#2
Posted 11 April 2011 - 06:44 AM
- Pick a starting block.
- Make a list of possible moves from that position adding them to a 'moves-to-check' list.
- For each of the moves in the moves-to-check list
- Is this move a solution? If so add the moves-made to the solution-list
- If not, does the move violate any of the restrictions (max length and not a solution)?
- If not, make a list of possible moves from this position and add them to a 'next-moves-to-check'
- Is this move a solution? If so add the moves-made to the solution-list
- Are there items in the next-moves-to-check list?
- If yes, then set moves-to-check to next-moves-to-check and loop back to 3.
Once this is done all possible solutions should be in your solution-list. If you use a queue structure you only need one 'moves-to-check' list.
#3
Posted 11 April 2011 - 06:50 AM
I'll try it out...
Thank you!
Thank you!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









