المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : help in solving a problem



C# Programming
10-08-2012, 11:12 PM
Riddle:
There are eight cards divided into 4 red and to 4 black.
You have to order them correctly, so that when the first card draw (no matter what color) next card must be different from the previous. Means to get a sequence of different colors.
For example:
Array A: Contains the colors: [b, b, b, A, A, b, A, A] (right to left).
When the first card pull the other card go to the end of the fund. Then pull the other card and it should be a different card from before.
That is supposed to go after the first card retrieval array like this: [a, b, b, b, a, a, b]
After another array retrieval is such that [a, a, b, b, b, a]
More retrieval [b, A, A, b, b]
More retrieval [b, b, A, A]
More Extract [a, b, b]
More retrieval [b, A]
More retrieval [b]
More retrieval and cash cards is all over and I got a set of cards (from left to right): [b, a, b, a, b, a, b, a]

1. Written operation in C # which accepts an array, the operation returns true if the array can solve the riddle another lie.
2. Written a program that runs the operation and returns the correct number sequence.
3., And also if you can to build a computational model of the program (that I just started learn computational models) so it will make it easier for members of the forum to better understand the program.


Thank
http://www.barakasoft.com/script/Forums/Images/smiley_smile.gif