Click here to Skip to main content
15,890,438 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# Exception Pin
Sandesh M Patil9-Apr-10 4:28
Sandesh M Patil9-Apr-10 4:28 
QuestionProcess in C#.. [modified] Pin
Sr...Frank9-Apr-10 4:06
Sr...Frank9-Apr-10 4:06 
AnswerRe: Process in C#.. Pin
Ian Shlasko9-Apr-10 4:14
Ian Shlasko9-Apr-10 4:14 
GeneralRe: Process in C#.. Pin
Sr...Frank9-Apr-10 4:18
Sr...Frank9-Apr-10 4:18 
GeneralRe: Process in C#.. Pin
Sr...Frank9-Apr-10 4:20
Sr...Frank9-Apr-10 4:20 
GeneralRe: Process in C#.. Pin
Ian Shlasko9-Apr-10 4:36
Ian Shlasko9-Apr-10 4:36 
AnswerRe: Process in C#.. Pin
PIEBALDconsult9-Apr-10 4:52
mvePIEBALDconsult9-Apr-10 4:52 
Questionplease i need the complation of 4 queen [modified] Pin
amrreko9-Apr-10 3:26
amrreko9-Apr-10 3:26 
please i need the complation of 4 queen only by my code for my doctor
we start
desgin from
node class
bfs class

to top expirt
please try to find by this method in simple code
by use my class and add to classes the miss code

form has two buttons
and grid 4x4
picture here
http://yfrog.com/0s91807548j[^]

class Node
    {

        public bool[,] state { set; get; }//1
        public Node parent { set; get; }//2
        public List<Node> childs { get; set; }//3
        //6
        public int level { get; set; }
        public int Hfunction()//4
        {
        int res=0;
            return res;
        }
        public void generate_child()//5
        {
            for (int i = 0; i < 4; i++)
            {
               //creat copy of an object then do castting
                bool[,] newstate = (bool[,])this.state.Clone();//8
                Node child = new Node();//7
                childs.Add(child);//add to list
                child.parent = this;//declare to parent
                child.level = this.level + 1;
                newstate[child.level, i] = true;//9
                child.state = newstate;
            }
        
        
        }
        //10
        public bool visited { get; set; }
        public Node GetBestChild()//11
        {

            int Min = int.MaxValue;//max value  12
            int min_index = -1;//out side range of index
            Node BestChild = null;//declare null value for bestchild node
            for (int i = 0; i < 4;i++ )
            {
                int CurrentValue = this.childs[i].Hfunction();
                if (CurrentValue < Min && this.childs[i].visited == false)
                {
                    BestChild = this.childs[min_index];//14
                    BestChild.visited = true;

                    Min = CurrentValue;//13
                    min_index = i;//13

                }


            }
         return BestChild;
        }

    class BFS
    {
        public Node BfsProcess(Node root)
        {
            Node soultion = null;
            if (root.Hfunction() == 4)
            {

                return root;
            }
            else {
                root.generate_child();
                Node bestchild =null;
                while ((bestchild = root.GetBestChild()) != null)
                {
                    soultion = BfsProcess(bestchild);
                
                }
                        return soultion;
            }

        }

    }<pre>
<div class="signature"><div class="modified">modified on Friday, April 9, 2010 10:39 AM</div></div>

AnswerRe: please i need the complation of 4 queen PinPopular
DaveAuld9-Apr-10 4:05
professionalDaveAuld9-Apr-10 4:05 
AnswerRe: please i need the complation of 4 queen Pin
Maximilien9-Apr-10 4:06
Maximilien9-Apr-10 4:06 
AnswerRe: please i need the complation of 4 queen PinPopular
Keith Barrow9-Apr-10 4:07
professionalKeith Barrow9-Apr-10 4:07 
GeneralRe: please i need the complation of 4 queen PinPopular
Ian Shlasko9-Apr-10 4:11
Ian Shlasko9-Apr-10 4:11 
GeneralRe: please i need the complation of 4 queen Pin
Keith Barrow9-Apr-10 4:15
professionalKeith Barrow9-Apr-10 4:15 
GeneralRe: please i need the complation of 4 queen Pin
Dalek Dave9-Apr-10 4:16
professionalDalek Dave9-Apr-10 4:16 
QuestionRe: please i need the complation of 4 queen code Pin
amrreko9-Apr-10 4:37
amrreko9-Apr-10 4:37 
AnswerRe: please i need the complation of 4 queen code Pin
Pete O'Hanlon9-Apr-10 4:56
mvePete O'Hanlon9-Apr-10 4:56 
AnswerRe: please i need the complation of 4 queen Pin
Dalek Dave9-Apr-10 4:10
professionalDalek Dave9-Apr-10 4:10 
AnswerRe: please i need the complation of 4 queen Pin
R. Giskard Reventlov9-Apr-10 4:12
R. Giskard Reventlov9-Apr-10 4:12 
AnswerRe: please i need the complation of 4 queen Pin
Pete O'Hanlon9-Apr-10 4:17
mvePete O'Hanlon9-Apr-10 4:17 
GeneralRe: please i need the complation of 4 queen Pin
R. Giskard Reventlov9-Apr-10 4:26
R. Giskard Reventlov9-Apr-10 4:26 
AnswerRe: please i need the complation of 4 queen Pin
loyal ginger9-Apr-10 4:26
loyal ginger9-Apr-10 4:26 
GeneralRe: please i need the complation of 4 queen Pin
Keith Barrow9-Apr-10 4:36
professionalKeith Barrow9-Apr-10 4:36 
GeneralRe: please i need the complation of 4 queen Pin
Media2r9-Apr-10 5:05
Media2r9-Apr-10 5:05 
GeneralRe: please i need the complation of 4 queen Pin
Keith Barrow9-Apr-10 5:09
professionalKeith Barrow9-Apr-10 5:09 
GeneralRe: please i need the complation of 4 queen Pin
amrreko9-Apr-10 5:09
amrreko9-Apr-10 5:09 

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.