Computer ai

Started by
18 comments, last by BeerNutts 12 years, 4 months ago
hey,
thanks for all the great feedback. i really cant figure anything out. maybe im over complicating it or its just so dam simple that i cant see it. Anyways to clarify, the program involves me or another person inputting a number and the computer guessing the number. I know how to use if statements, else clause, switch, do and while loops and variables. if you guys could help me using those keywords that would be great. and again please don't send me code i wont learn that way.
thanks :)
Advertisement
If you have some attempt that isn't working, you should post it. If you don't have any code, write down a detailed explanation in English of how one would go about doing what the program needs to do, and post it.

If you have some attempt that isn't working, you should post it. If you don't have any code, write down a detailed explanation in English of how one would go about doing what the program needs to do, and post it.



The program is meant to have a player input a number. If the number is too high it says lower and if it is to low it says higher and if you get it then it says correct. it also needs to loop.

I know how to do everything except the AI i have no freaking idea however in the book i am learning from it says to do it so i guess i should be able to. all i want to know is how to make the computer guess my number randomly using the keywords i stated in my third and first post.

all i want to know is how to make the computer guess my number randomly using the keywords i stated in my third and first post.

You know how a human would guess the correct answer, right? Think that process through very carefully - the AI needs to take the exact same steps you would yourself.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]


[quote name='Crusable77' timestamp='1322872542' post='4889970']
all i want to know is how to make the computer guess my number randomly using the keywords i stated in my third and first post.

You know how a human would guess the correct answer, right? Think that process through very carefully - the AI needs to take the exact same steps you would yourself.
[/quote]

OMG, thank you so much! after reading this it was like BOOM epiphany.. thanks for all your help ill post the code when its done.
Sorry I have to resurrect this, and feel free to strike me down or ban my account, or add another "dislike" to this post, but i have a bone to pick.

Why was my post disliked twice? My post was not a hindrance to the OP nor is it anything that should be disliked, regardless if the code in it is python or C++. The simple fact that I posted a working solution, which is by far easier to follow and understand than a C++ implementation, and when given what the OP just said right after my post about his personal knowledge of programming, is ridiculous, especially considering I've done nothing but try to help users on this forum since I've signed up. I honestly can't believe how ridiculous and elitist some of the users are here.

Edit:
Honestly if you think my post was SOOOO frickin' disruptive in helping this user, then delete it and don't soil my meager amount of reputation points I've managed to accumulate by helping numerous other people on this forum. As if I had any amount of credibility before, whatever was left is now gone since, you know, posting a working solution for someone is clearly a regress in every respect and not progress what so ever. (/end sarcasm)

Sorry I have to resurrect this, and feel free to strike me down or ban my account, or add another "dislike" to this post, but i have a bone to pick.

Nobody is going to be wielding the ban-hammer. However, I will clarify that I feel our post failed to be constructive, on the following grounds:


  • The OP specifically asked that no one post code solutions.
  • The OP mentioned they are beginning C++. Python is indeed easier for you or I to read, but not necessarily so for someone just starting out
  • A recursive solution is only going to confuse someone who hasn't learned recursion yet.

Honestly if you think my post was SOOOO frickin' disruptive in helping this user, then delete it and don't soil my meager amount of reputation points I've managed to accumulate by helping numerous other people on this forum.[/quote]
To be honest, I considered deleting both your and alvaro's solutions, not because they are both show-off solutions which do not address the OP's stated question, but rather because there is a fair chance that this is a homework question, to which we do not provide code answers. I let them stand because they might be useful to others.

As if I had any amount of credibility before, whatever was left is now gone since, you know, posting a working solution for someone is clearly a regress in every respect and not progress what so ever. (/end sarcasm)[/quote]
You are placing way too much value on reputation points. They are just an abstract indicator of some indefinable quantity that nobody is quite sure about... I don't think anyone actually takes notice of them - I certainly don't.

I am entirely willing to debate the point further, but I'd appreciate if we avoid further polluting this thread. Feel free to private message me, or create a new thread in the Comments & Suggestions forum to continue the discussion.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]


Why was my post disliked twice?


One of those was me, by accident. And there is no way for me to change it (which is a pretty weird thing that perhaps deserves a thread in the Comments & Suggestions forum). I'll "like" your other post just to balance things out, if it matters to you.

You should probably continue to help others because you feel it's the right thing to do, and ignore the broken reputation system.
It's not a big deal. I probably could have avoided losing those 2 rep points if i just simply added something to my post explaining NOT to use recursion when solving a problem that can be implemented better iteratively since the problem is iterative in nature and no recursive data structures need to be used, but given the OP, I would not have expected comprehension of such comment, so I just posted code.

In my defense, his original post could be interpreted two different ways; he was either asking for advice in addition to/while expecting pasted code blocks, or exclusively asking for advice only and no code. I interpreted it as the former. "Aside from this, do this", to me, sounds like he wanted us to post code AND give advice. My sincerest apologies if I was wrong.

It's not a big deal. I probably could have avoided losing those 2 rep points if i just simply added something to my post explaining NOT to use recursion when solving a problem that can be implemented better iteratively since the problem is iterative in nature and no recursive data structures need to be used, but given the OP, I would not have expected comprehension of such comment, so I just posted code.

In my defense, his original post could be interpreted two different ways; he was either asking for advice in addition to/while expecting pasted code blocks, or exclusively asking for advice only and no code. I interpreted it as the former. "Aside from this, do this", to me, sounds like he wanted us to post code AND give advice. My sincerest apologies if I was wrong.


2 things:

#1, The OP is obviously in the early stages of learning to program, and you post not only a recursive algorithm to solve the problem, it's not even in C++, which, again, the OP is using. He may have tried to copy some of your code not knowing it wouldn't compile. (BTW, I wasn't one of the dislikers, but the reasons are obvious).

#2, asking why your post was disliked typically only results in THAT post being disliked as well.

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

This topic is closed to new replies.

Advertisement