Click here to Skip to main content
13,355,538 members (76,800 online)


Questionhelp in solving a problem Pin
michae1108-Oct-12 7:24
membermichae1108-Oct-12 7:24 
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.

Smile | :)
AnswerRe: help in solving a problem Pin
Richard MacCutchan8-Oct-12 7:57
mvpRichard MacCutchan8-Oct-12 7:57 
AnswerRe: help in solving a problem Pin
Dave Kreskowiak8-Oct-12 12:00
mvpDave Kreskowiak8-Oct-12 12:00 
AnswerRe: help in solving a problem Pin
Abhinav S8-Oct-12 18:37
mvpAbhinav S8-Oct-12 18:37 
AnswerRe: help in solving a problem Pin
Paul Conrad10-Oct-12 8:46
memberPaul Conrad10-Oct-12 8:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Advertise | Privacy |
Web01 | 2.8.180111.1 | Last Updated 22 Jan 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid