My First Game

Started by
7 comments, last by Omnesolis 23 years, 10 months ago
Well, since I''m fairly new to C++, it''s gonna be text-based, and simple. Any suggestions? I had thought about doing a text version of tic-tac-toe, but that would require AI, which I''m not ready for. Any help would be greatly appreciated.
Advertisement
If you''re looking for text based games that don''t use AI, here are a few you might consider:

Blackjack
Craps (the dice game)
Hangman (read random words from a text file and use those)

Hope this helps!
Y''know, tic tac toe doesn''t have to be against
a computer. You could do a 2 player tic tac toe.
Then if you feel like it later, you can try to
add in AI.


----------
Disco Love For Everyone
----------"i think that all this talking and such is paining my head to astounding annoyance" - Erick"Quoting people in your tag is cool. Quoting yourself is even cooler" - SpazBoy_the_MiteyDisco Love For Everyone
My first game was a simple text based version of Roulette, its fairly easy to make and uses alot of the functions you will have to get used to for later games. Best of all you can contiue to add new options to it as you get better in programming, start off with just trying to guess the numbers, then add the black and red, then rows, colums, etc.

Glandalf
My first game, first version of which I finished just yesterday, was a very simple one-player worm game in 640x480x16 VGA, using putpixel() function to move the worm''s head forward and delay() function to change the worm speed. I used getpixel() to define if a certain cp (current position) is "empty" (a black pixel).

I think that a program like this is one of the very simplest games to start with.
http://www.codeflow.fi/
Hmm....I''m working on a "Guess a number between 1 and 10" game right now, to see how things work. After that, I''ll probably make it into some text-based card game or something...

Just keeping you all informed

BTW, does anyone in here know the forum ratings, like I''m an initiate? What are the post counts for the other rankings?
Text based rpgs are fun to make.

ECKILLER
ECKILLER
Could I see that code, castaway? I''m a mega newbie and could seriously benefit, I think

superpeon1@aol.com if you don''t mind....

Thanks in advance,

Peon
Peon
You could still do Tic-Tac-Toe, since the AI in it can be fairly simple.

There is very little strategy to Tic-Tac-Toe. I once analyzed the whole game with all possible outcomes and found what the odds of winning are in every possible location. You could make an AI that would not allow the player to ever win, since there are certain places to go according to where the other person goes to automatically make it a cats game.

For the reason that strategy is so low and that implementing it would only frustrate any player the best choice would be to randomize the computers choices. (Pretend the board is labeled 1 2 3, 4 5 6, 7 8 9 in rows respectively.) The computer would only have to know that is squares 1 and 2 had an X, that it should put an X in 3 to win so that it could win, and that if squares 1 and 2 had an O, that it should put an X in 3 to blcok so that the player would not get automatic wins.

Other than blocking and winning, the moves could be completely random and the game would be just fine. You might want to have the computer know to put its mark in places where it might cuase a win (not going 1 and 8 for instance). I have created a Tic-Tac-Toe game on the Macintosh and the TI-83 Calculator following the block/win/random principle and they both play fine. I mean, its Tic-Tac-Toe, how complex do you want it? Besides, no one should ever win Tic-Tac-Toe if both players know what they are doing (so don''t let the computer know how to do it perfectly!)

Another good thing about Tic-Tac-Toe is the fact that there are so very little possible game scenarios. Though it may seem like a lot, there are very little, since the board can be rotated and still be the same board (I hope that makes sense). An X in 1 and 3 is the exact same thing as having an X in 3 and 9 or 1 and 7 or 7 and 9. Its just rotated. So if you really did want it to test for strategy, then you could always just rotate the values and test for the same things.

Well, thats kind of long about Tic-Tac-Toe. There''s probably more I could say, such as chances of winning based on certain starting moves (I believe its 87.5% in the corners [don''t remember exact]).

-Blair Heuer

This topic is closed to new replies.

Advertisement