Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How do I write a minimax c# code to show the results of the game tree from this info provided...

How do I write a minimax c# code to show the results of the game tree from this info provided...

Scheduled Pinned Locked Moved C / C++ / MFC
csharpgame-devdata-structuresjsonquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Angelinna
    wrote on last edited by
    #1

    using System; using System.Collections.Generic; using System.Text; public class Minimax { static void Main(string[] args) { // generate a simple game tree, starting with the root Tree tree = new Tree(0); // children of the root tree.children = new Forest(new int[] { 0, 0 }); // children of the left child of the root tree.children.first.children = new Forest(new int[] { 0, 7, 9 }); // children of the right child of the root tree.children.rest.first.children = new Forest(new int[] { 4, 8, 6 }); // children of the leftmost child of the left child of the root tree.children.first.children.first.children = new Forest(new int[] { 5, 3, 1 }); // write the expected and calculated minimax values to the console Console.WriteLine("Expected minimax value is 5"); Console.WriteLine("Calculated minimax value of the tree " + tree.Minimax(true)); //Console.Write(tree.children.first); Console.WriteLine("Press any key to exit ..."); Console.ReadKey();

    C D 2 Replies Last reply
    0
    • A Angelinna

      using System; using System.Collections.Generic; using System.Text; public class Minimax { static void Main(string[] args) { // generate a simple game tree, starting with the root Tree tree = new Tree(0); // children of the root tree.children = new Forest(new int[] { 0, 0 }); // children of the left child of the root tree.children.first.children = new Forest(new int[] { 0, 7, 9 }); // children of the right child of the root tree.children.rest.first.children = new Forest(new int[] { 4, 8, 6 }); // children of the leftmost child of the left child of the root tree.children.first.children.first.children = new Forest(new int[] { 5, 3, 1 }); // write the expected and calculated minimax values to the console Console.WriteLine("Expected minimax value is 5"); Console.WriteLine("Calculated minimax value of the tree " + tree.Minimax(true)); //Console.Write(tree.children.first); Console.WriteLine("Press any key to exit ..."); Console.ReadKey();

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      This is the Visual C++ forum, so please post your question in the C# forum.

      Cédric Moonen Software developer
      Charting control [v1.5] OpenGL game tutorial in C++

      1 Reply Last reply
      0
      • A Angelinna

        using System; using System.Collections.Generic; using System.Text; public class Minimax { static void Main(string[] args) { // generate a simple game tree, starting with the root Tree tree = new Tree(0); // children of the root tree.children = new Forest(new int[] { 0, 0 }); // children of the left child of the root tree.children.first.children = new Forest(new int[] { 0, 7, 9 }); // children of the right child of the root tree.children.rest.first.children = new Forest(new int[] { 4, 8, 6 }); // children of the leftmost child of the left child of the root tree.children.first.children.first.children = new Forest(new int[] { 5, 3, 1 }); // write the expected and calculated minimax values to the console Console.WriteLine("Expected minimax value is 5"); Console.WriteLine("Calculated minimax value of the tree " + tree.Minimax(true)); //Console.Write(tree.children.first); Console.WriteLine("Press any key to exit ..."); Console.ReadKey();

        D Offline
        D Offline
        Dhiraj kumar Saini
        wrote on last edited by
        #3

        please adhere to the forum rules and regulations.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups