Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Games and AI, and maybe some other stuff

I am making a game in which I will train and etc. different computer players to play against each other. It will be one of my first full blown projects in C++ (before I did all my programming in basic from pre-gw to vb sigh...) My problem is though that I am having trouble in my cpp programming that I don't get the thing with Lvalues etc. I end up just throwing in a "*" before my variables and fooling around with the order of them...Help on this subject would be nice...



Back to the game: anyways its an old travel game that my family called: "The four letter word game" (pretty complex eh?) Each person comes up with a four-letter word with no doubled letters (eg. moon is not allowed, cabs is) and then take turns guessing the words. To help them along the other person compares their guess with their word and if there is a letter in the right place (eg boNe and caNt) it is a bull's-eye. If it's the right letter in the wrong place (eg cabS and Snow) it is a hit. if there is no matching letters you've missed. You tally up the points and try to guess untill you've got their word.



The First program I am making generates a four digit random string and I try to guess it, while it tells me how well I am doing...I can't seem to find a cpp equivilent to chr$() BASIC function... I tried programming one too, but it's not working.... Again, any help would be appreciated...



Later versions of the game will include training cpu people to gain greater vocabularies and keep track of the frequency of letters used in correct answers and the frequency of words containing hits, bull's-eyes, and being the answer.



Any help on my problems/comments and furtherings on the idea would be appreciated!



Thx....Beamer


Comments

  • : The First program I am making generates a four digit random string and I try to guess it, while it tells me how well I am doing...I can't seem to find a cpp equivilent to chr$() BASIC function... I tried programming one too, but it's not working.... Again, any help would be appreciated...


    Well you'll need to remember that the char variable type is also just a number. Thus you generate a random sequence of letters by making your random number generator generate a number from 1 to 26 and add it to 64. This will produce an ASCII character (a letter).


    Good luck.


    -Xotor-





Sign In or Register to comment.