Programming AI in C++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hunderpanzer
    New Member
    • Jul 2007
    • 60

    #16
    Originally posted by chessmanexe
    erm...Please dont think of me as a flamer, because i am that in the lease, I am new to C++, and i have come to find, IT WILL be a long way to go until i have a functioning AI, I understand that now. As for the website/app thing, you might have misunderstood. I meant to say, "I want a button that SAYS website on it, and when you click it, it opens up IE/FF/Opera/Safari/whatever (>_>) and takes you to my website xxxx@xxxx.xxx.x in case you didn't understand.

    I am very sorry if you thought i was on my way to flaming, i wasn't. As for the C++ "color wheel" (0xff) Is there any reference as to where it is?

    and, as for the other questions, i will go look further for them. I will ask questions here, but i dont want to be victimized as one of those flamers ;)

    thanks in advance.
    Hello

    I have a C++ function that I use to make my colors, and I've mapped them out until the pattern is noticeable.
    I must admit, it's not MY own creation, I found it off a program a long time ago, and I've forgotten where and what.

    C++ Text colors I can help you with, though I'm not sure you would understand it. . .Do you have any programming experience ?

    Sorry your other questions are beyond my knowledge.
    Last edited by Hunderpanzer; Aug 16 '07, 05:31 AM. Reason: Made it more clear

    Comment

    • arunmib
      New Member
      • May 2007
      • 104

      #17
      hmm....I expected a healthy discussion on AI (in C++).....hmm... ..

      Anyways, Books are good mentors than people. Start reading them, For getting a good idea about AI, Expert systems algorithms try "Artificial Intelligence Application Programming - M.Tim Jones". This book is pretty neat with example programs(in C).

      Colorwheel - I think it comes as a dialog with Visual Studio. Since you are building an windows executable and in starting stage of the project you can switch to a visual studio (if possible) instead of Dev-Cpp. The reason I am suggesting is many of the windows features comes for free with it (visual studio).

      Other than that, go through good books for windows programming for eg: as one of the previous poster mentioned try "Programmin g Windows by Charles Petzold" . Another website for good C/C++ reference would be "www.cprogrammi ng.com" .

      I hope my post is of some help to you.....

      Comment

      • sicarie
        Recognized Expert Specialist
        • Nov 2006
        • 4677

        #18
        Originally posted by arunmib
        hmm....I expected a healthy discussion on AI (in C++).....hmm... ..
        Arunmib-

        Perhaps you can share what challenges you have run into (and hopefully spark the type of conversation you hoped for), experiences you have had, general thoughts/ideas?

        Comment

        • RedSon
          Recognized Expert Expert
          • Jan 2007
          • 4980

          #19
          Originally posted by chessmanexe
          erm...Please dont think of me as a flamer, because i am that in the lease, I am new to C++, and i have come to find, IT WILL be a long way to go until i have a functioning AI, I understand that now. As for the website/app thing, you might have misunderstood. I meant to say, "I want a button that SAYS website on it, and when you click it, it opens up IE/FF/Opera/Safari/whatever (>_>) and takes you to my website xxxx@xxxx.xxx.x in case you didn't understand.

          I am very sorry if you thought i was on my way to flaming, i wasn't. As for the C++ "color wheel" (0xff) Is there any reference as to where it is?

          and, as for the other questions, i will go look further for them. I will ask questions here, but i dont want to be victimized as one of those flamers ;)

          thanks in advance.
          Just to clarify I didn't think you were going to start the flames. So no worries.

          Comment

          • chessmanexe
            New Member
            • May 2007
            • 24

            #20
            alright, i'll search for vs, but i can't download it from the microsoft official website because i am on a mac and cant download a lot from the microsoft website...see? any of you have any good websites that have a lot of microsoft stuff on it, but doesn't require you having a windows computer
            thanks again.

            Comment

            • JosAH
              Recognized Expert MVP
              • Mar 2007
              • 11453

              #21
              I don't understand what colour theory has to do with artificial intelligence?

              Colours described in a 3 dimensional sRGB space are quite easy to understand.

              kind regards,

              Jos

              Comment

              • daJunkCollector
                New Member
                • Jun 2007
                • 76

                #22
                Why are you partial to Waterloo's distance education program? I ask because I have my Bachelor's Degree and am interested in pursuing an online education for Programming (particularly web development, but I am open to suggestion).

                Comment

                • chessmanexe
                  New Member
                  • May 2007
                  • 24

                  #23
                  color is going to be used in the text, background, and probably used on the navigator i mentioned earlier, as for the waterloo thing, i have no idea what it is. :\
                  sry, never heard of it.

                  Comment

                  • chessmanexe
                    New Member
                    • May 2007
                    • 24

                    #24
                    *bump

                    Can i bump? :\ nyway i still need help, what is the waterloo?

                    Comment

                    • arunmib
                      New Member
                      • May 2007
                      • 104

                      #25
                      Originally posted by sicarie
                      Arunmib-

                      Perhaps you can share what challenges you have run into (and hopefully spark the type of conversation you hoped for), experiences you have had, general thoughts/ideas?
                      Challenges I ran into may or may not be of use here, but nevertheless if required I will share them. But what a good programmer would do (in my belief) is spend considerable time in choosing an algorithm for the problem. So if the guy can give a glimpse of his project's essence and his algorithm, his design methodology to achieve it may be people in here can chip in their ideas. We all can have an constructive discussion about it. It not only enlightens him, but also SIMPLE guys like me. This is what I expected when I opened this thread. Hey this doesn't means he must ask the questions he has asked here, it's just the thread title and the way discussion was heading made me use those words.

                      Moreover the guy was using some BIG words like MENTOR, since a single person here without some personal contact can't be one, but the whole THESCRIPTS website can, I think....

                      P.S : Please don't start a discussion or reply post for this post of mine. Lets get to programming business people we all are GOOD mainly in it. Sorry, for the late reply I was OUT for the weekend ...
                      Last edited by arunmib; Aug 20 '07, 05:42 AM. Reason: comments

                      Comment

                      • chessmanexe
                        New Member
                        • May 2007
                        • 24

                        #26
                        I dont know what algorythm i could use, but im sure with everyones help, i'll make a good decision...mayb e not :\

                        Comment

                        • chessmanexe
                          New Member
                          • May 2007
                          • 24

                          #27
                          finally found a good question, in this sequence of code, i am trying to change the background to an image...bmp if it matters...just look 8^)

                          Code:
                          #include <windows.h>
                          
                          
                          
                          /*  Declare Windows procedure  */
                          
                          LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
                          
                          
                          
                          /*  Make the class name into a global variable  */
                          
                          char szClassName[ ] = "WindowsApp";
                          
                          
                          
                          int WINAPI WinMain (HINSTANCE hThisInstance,
                          
                                              HINSTANCE hPrevInstance,
                          
                                              LPSTR lpszArgument,
                          
                                              int nFunsterStil)
                          
                          
                          
                          {
                          
                              HWND hwnd;               /* This is the handle for our window */
                          
                              MSG messages;            /* Here messages to the application are saved */
                          
                              WNDCLASSEX wincl;        /* Data structure for the windowclass */
                          
                          
                          
                              /* The Window structure */
                          
                              wincl.hInstance = hThisInstance;
                          
                              wincl.lpszClassName = szClassName;
                          
                              wincl.lpfnWndProc = WindowProcedure;      /* This function is called by windows */
                          
                              wincl.style = CS_DBLCLKS;                 /* Catch double-clicks */
                          
                              wincl.cbSize = sizeof (WNDCLASSEX);
                          
                          
                          
                              /* Use default icon and mouse-pointer */
                          
                              wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
                          
                              wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
                          
                              wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
                          
                              wincl.lpszMenuName = NULL;                 /* No menu */
                          
                              wincl.cbClsExtra = 0;                      /* No extra bytes after the window class */
                          
                              wincl.cbWndExtra = 0;                      /* structure or the window instance */
                          
                              /* Use Windows's default color as the background of the window */
                          
                              wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
                          
                          
                          
                              /* Register the window class, and if it fails quit the program */
                          
                              if (!RegisterClassEx (&wincl))
                          
                                  return 0;
                          
                          
                          
                              /* The class is registered, let's create the program*/
                          
                              hwnd = CreateWindowEx (
                          
                                     0,                   /* Extended possibilites for variation */
                          
                                     szClassName,         /* Classname */
                          
                                     "Windows App",       /* Title Text */
                          
                                     WS_OVERLAPPEDWINDOW, /* default window */
                          
                                     CW_USEDEFAULT,       /* Windows decides the position */
                          
                                     CW_USEDEFAULT,       /* where the window ends up on the screen */
                          
                                     544,                 /* The programs width */
                          
                                     375,                 /* and height in pixels */
                          
                                     HWND_DESKTOP,        /* The window is a child-window to desktop */
                          
                                     NULL,                /* No menu */
                          
                                     hThisInstance,       /* Program Instance handler */
                          
                                     NULL                 /* No Window Creation data */
                          
                                     );
                          
                          
                          
                              /* Make the window visible on the screen */
                          
                              ShowWindow (hwnd, nFunsterStil);
                          
                          
                          
                              /* Run the message loop. It will run until GetMessage() returns 0 */
                          
                              while (GetMessage (&messages, NULL, 0, 0))
                          
                              {
                          
                                  /* Translate virtual-key messages into character messages */
                          
                                  TranslateMessage(&messages);
                          
                                  /* Send message to WindowProcedure */
                          
                                  DispatchMessage(&messages);
                          
                              }
                          
                          
                          
                              /* The program return-value is 0 - The value that PostQuitMessage() gave */
                          
                              return messages.wParam;
                          
                          }
                          
                          
                          
                          
                          
                          /*  This function is called by the Windows function DispatchMessage()  */
                          
                          
                          
                          LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
                          
                          {
                          
                              switch (message)                  /* handle the messages */
                          
                              {
                          
                                  case WM_DESTROY:
                          
                                      PostQuitMessage (0);       /* send a WM_QUIT to the message queue */
                          
                                      break;
                          
                                  default:                      /* for messages that we don't deal with */
                          
                                      return DefWindowProc (hwnd, message, wParam, lParam);
                          
                              }
                          
                          
                          
                              return 0;
                          
                          }
                          all this code is is just a windows application, standard 800x600 window with a grey background.
                          I am guessing at "(HBRUSH) COLOR_BACKGROUN D;" I can change this around and make it into a picture background. How exactly would i do this, i researched and researched and tried merging different open source codes together, but nothing came out the way i wanted. how would i change "(HBRUSH) COLOR_BACKGROUN D;" into a picture?
                          I actually have 2 pics, so how would i make it automatically switch from one pic to another on a timed scale.

                          Thanks so much, and it will probably be a long while till i fully understand C++.
                          but inside this first month i am getting it so much more. thank you.

                          Comment

                          • RedSon
                            Recognized Expert Expert
                            • Jan 2007
                            • 4980

                            #28
                            Originally posted by chessmanexe
                            finally found a good question, in this sequence of code, i am trying to change the background to an image...bmp if it matters...just look 8^)

                            all this code is is just a windows application, standard 800x600 window with a grey background.
                            I am guessing at "(HBRUSH) COLOR_BACKGROUN D;" I can change this around and make it into a picture background. How exactly would i do this, i researched and researched and tried merging different open source codes together, but nothing came out the way i wanted. how would i change "(HBRUSH) COLOR_BACKGROUN D;" into a picture?
                            I actually have 2 pics, so how would i make it automatically switch from one pic to another on a timed scale.

                            Thanks so much, and it will probably be a long while till i fully understand C++.
                            but inside this first month i am getting it so much more. thank you.
                            Actually you can't change that to a bitmap. Once you create your window you will need to draw your bitmap on the window. I'm not sure what you are trying to do by drawing a bitmap on the background of the screen so can you describe what you are trying to do a bit more and we'll see if we can't help you? In the mean time you can search MSDN for WNDCLASSEX and CreateWindow and also Using Bitmaps.

                            Try this link http://msdn2.microsoft.com/en-us/library/ms532276.aspx

                            Comment

                            • chessmanexe
                              New Member
                              • May 2007
                              • 24

                              #29
                              Here's the problem, I dont even know where exactly in that code i can draw the bitmap pic, so if you could help me out that would be great >_>

                              Comment

                              • RedSon
                                Recognized Expert Expert
                                • Jan 2007
                                • 4980

                                #30
                                Originally posted by chessmanexe
                                Here's the problem, I dont even know where exactly in that code i can draw the bitmap pic, so if you could help me out that would be great >_>
                                You will probably want to look for the WM_PAINT message and then paint your bitmap at that time. Did you look at thelink?

                                Comment

                                Working...