homeyg's newest game programmed with C++!

homeyg

Deity
Joined
Jan 12, 2004
Messages
3,631
My last game, Four Squares (in my sig), was not that good, I'm willing to admit. :lol: This time, I've programmed a one player strategy game called 'homeyg's Nuclear Wars'! Even though it is without graphics, I have implemented text colors in this one. I need some people to test it for me, give suggestions, give ideas about what else to add, whatever. So, I'll post the code and then the .exe. (the code is 463 lines and without comments, yes I know it's a bad habit)

PLEASE LOOK BELOW FOR CODE AND .EXE!!!

Btw, the game has a short tutorial if you want one.
 
Do i need any programs to run it or plug-ins?
 
No, just run the .exe.

Hey, I'm not going to make up an individual name for each counter!
 
Very nice. :) Perhaps you want to include a section on what "O" and "M" stand for... I thought O meant something I had to destroy with a nuke. :blush:

I got a reputation of 8 my first time..
 
OK, i'll try it out tomorrow :).
 
Ginger_Ale said:
Very nice. :) Perhaps you want to include a section on what "O" and "M" stand for... I thought O meant something I had to destroy with a nuke. :blush:

I got a reputation of 8 my first time..

Thanks! :goodjob: Sorry about that. 'M' stands for military site (the things you need to destroy) 'O' stands for nothing. It means you went on a spy run but uncovered nothing of major importance.

Also I uncovered some major bugs in the program and I updated a few things, so I'm including the new .exe down below. Please people, offer suggestions and criticism (constructive or non-constructive, whichever). I want to make this one as good as possible.
 
Here's a few tips for your old game:

1 - Don't clear the screen each time. It's a little annoying.
2 - Don't even redraw anything. Make an "InitBoard()" function that sets up each "cell".
3 - Use a function (using gotoXY) that places the disc whever you want it to go.
4 - Make a better user interface. Two ways:

a. The easy way:

Create a prompt that will go after the board is drawn. When the user enters a value, place the disc where it should go.

b. The hard way:

Use 1 line (up top) as your selection line. Use a character, like "V" as your pointer. When the user presses left and right (you'll need to read the keycode), move the pointer. This is done by erasing (using gotoXY, and writing " ") the pointer, and putting it into the new position. Each time you move it, update the column number.

In psuedo-code:

if (!col == 0) col--;
if (!col == max) col++;

// max being the maximum row number. (Note how I started with 0).
 
homeyg said:
Okay, Chieftess, try this out: Updated Connect Four

Ok, not to be nitpicky, but...

1 - It's possible to send it into an infinite loop when selecting a column by entering in a non-numeric character.

2 - It's possible to select a column that's already full. When that happens, the screen is blank when it refreshes.
 
Got those bugs plus a few more I caught! Those better be the last!!

Btw, why am I experiencing so much lag when trying to move around the forums. It takes 1-2 minutes for each page I go to to load when usually it takes 2-3 seconds.
 
homeyg said:
Got those bugs plus a few more I caught! Those better be the last!!

Btw, why am I experiencing so much lag when trying to move around the forums. It takes 1-2 minutes for each page I go to to load when usually it takes 2-3 seconds.

It would be better to go back to the origanal line and re-write the message. A bunch of wrong characters can fill up the screen with "Please select a column".

Bug found! :p If player 1 selects an invalid column (or letter), then it goes to player 2's turn.

Another thing - ask the player if they want to play again.
 
:lol: The thing about it skipping to player two's turn was simply a typo when 'cout'ing "Please select a correct column player 1." It doesn't actually go to player 2's turn. :lol:
 
homeyg said:
:lol: The thing about it skipping to player two's turn was simply a typo when 'cout'ing "Please select a correct column player 1." It doesn't actually go to player 2's turn. :lol:

It's still one to fix. Could lead to user error. ;)
 
Chieftess! You've drawn my thread off-topic!! [offtopic] :nono: :eek:


Anyway, I've updated the Nuclear Wars game so it includes complete error checking during input. :scan:

Can't attach the code because that makes the post too many characters. :hmm:
 
Any code in your previous game can always be carried over to the new one. ;) (such as catching input that's greater than the number of columns in the new game)

Especially if you make header files, or even DLLs.
 
Crazy enough, I still don't really know what a DLL is and I surely don't know how to use one.... :hmm:
 
DLL = "Dynamicly Linked Library"

It's a file that keeps code so you can use it in multiple places. I know in C++, it might be a bit tricky to use. (much easier in Visual C# and Visual Basic)
 
Back
Top Bottom