You can create a program like this?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10

Thread: You can create a program like this?

  1. #1
    Join Date
    Mar 2013
    Posts
    4

    Question You can create a program like this?

    Hello Guys,

    Someone can tell me if it is possible to create a program like Robocode, a game controlled at runtime by an external source file in visual c ++? For example create a checkers game where there would be an external source file, read at runtime, which would play automatically, with artificial intelligence. You can? If yes, how?

  2. #2
    ovidiucucu's Avatar
    ovidiucucu is offline Moderator/Reviewer Power Poster
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,021

    Re: You can create a program like this?

    If I can? Probably yes.
    How? Sweating a lot.
    Ovidiu Cucu
    "When in Rome, do as Romans do."
    Visit: Microsoft Virtual Academy
    Follow: https://twitter.com/#!/ovidiucucu
    My blog: http://codexpert.ro/blog/author/ovidiu-cucu/

  3. #3
    Join Date
    Mar 2013
    Posts
    4

    Re: You can create a program like this?

    Quote Originally Posted by ovidiucucu View Post
    If I can? Probably yes.
    How? Sweating a lot.
    Oh, sorry for my bad english, i wanted to say: "it is possible create a program like this?" how to interpret the code at runtime with c++? I have no idea how to do...

  4. #4
    Join Date
    Apr 1999
    Posts
    27,426

    Re: You can create a program like this?

    Quote Originally Posted by ordan1 View Post
    Oh, sorry for my bad english, i wanted to say: "it is possible create a program like this?" how to interpret the code at runtime with c++? I have no idea how to do...
    So do you think that someone is going to post thousands, if not millions of lines of code? What answer are you expecting us to give you?

    The best answer came from ovidiu -- hard work, study, and a lot of sweating. What you ask for is very advanced, and must be broken down into individual modules. Even an advanced programmer would have sleepness nights trying to come up with all of these details you described.

    Regards,

    Paul McKenzie

  5. #5
    Join Date
    Mar 2013
    Posts
    4

    Re: You can create a program like this?

    Quote Originally Posted by Paul McKenzie View Post
    So do you think that someone is going to post thousands, if not millions of lines of code? What answer are you expecting us to give you?

    The best answer came from ovidiu -- hard work, study, and a lot of sweating. What you ask for is very advanced, and must be broken down into individual modules. Even an advanced programmer would have sleepness nights trying to come up with all of these details you described.

    Regards,

    Paul McKenzie
    Millions of lines of code to read and execute source code? I do not know if you understood my idea or seen the Robocode, but would for example something like this: There would be a square on the screen and the user would send a source code with predefined functions to move the square, for example "move up "," move down ", etc.. I'm not asking you to do this for me. I do not have much experience with object-oriented language, I am still studying, just wanted to know the possibility and viability of doing something. I think it would be easier with Java, being an interpreted language, but wanted to do in C + +, however I can not find stuff on the internet about it. Java would be more viable?

  6. #6
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Posts
    12,068

    Re: You can create a program like this?

    That's not "source code", that's just a file that contains instructions. That could be fairly simple. Read the file, match the instruction to an action and execute the action. Your question is still pretty vague to give a detailed answer.

  7. #7
    Join Date
    Apr 1999
    Posts
    27,426

    Re: You can create a program like this?

    Quote Originally Posted by ordan1 View Post
    There would be a square on the screen and the user would send a source code with predefined functions to move the square, for example "move up "," move down ", etc.. I'm not asking you to do this for me. I do not have much experience with object-oriented language, I am still studying, just wanted to know the possibility and viability of doing something.
    Of course someone or some team of programmers can write such a program.
    I think it would be easier with Java, being an interpreted language, but wanted to do in C + +, however I can not find stuff on the internet about it.
    And what is the "stuff" you're looking for? Wouldn't it be source code or libraries?

    Regards,

    Paul McKenzie

  8. #8
    Join Date
    Mar 2013
    Posts
    4

    Re: You can create a program like this?

    Quote Originally Posted by GCDEF View Post
    That's not "source code", that's just a file that contains instructions. That could be fairly simple. Read the file, match the instruction to an action and execute the action. Your question is still pretty vague to give a detailed answer.
    Have you seen Robocode?

    I wanted to do something like this: http://ideone.com/QL9nU5
    The user would play with your code, without interfering in the source code or visual game

    Robocode is like that but it is in java

  9. #9
    Join Date
    Apr 1999
    Posts
    27,426

    Re: You can create a program like this?

    Quote Originally Posted by ordan1 View Post
    Robocode is like that but it is in java
    Your original question was answered.

    1) Yes, practically any software can be created with C++.

    2)
    You can? If yes, how?
    This is where you're vague. Just asking us "how" is an open-ended question. It's like asking someone "can you build a skyscraper", and then asking "how?".

    Regards,

    Paul McKenzie

  10. #10
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,333

    Re: You can create a program like this?

    You can? If yes, how?
    By first producing a program design and then crafting the correct c++ code from the design. The hard part is nearly always producing the design because that is where most of the thinking has to be done. What input/output is needed, what classes are needed, how they interface with each other etc etc etc. None of this is directly related to c++. The design if done properly could then be coded in any suitable language.
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center