C game programming help

Started by
1 comment, last by Norman Barrows 7 years, 2 months ago

I'm working on a college assignment, attached are the instructions, I don't want anyone to write code for me or anything like that, I just want to know how would you doing, what coding techniques would you use.

This is what I have so far http://pastebin.com/cr1akF40 if you can give me some sugestions on how you would build up on what I have, that would also be great. Thanks

The part in the instructions about writing in assembly is optional, so I'm not planning on doing that

Advertisement

Being careful about the "no homework" policy...

I would start by considering the rules of the game as described. Figure out how to encode them to most easily interpret the rules.

Then I would use that as my guide for implementation. Figure out an order to implement the rules that makes sense. Then add one rule and the code required to meet it. Add another rule and its required code. For a "real" project each one would be accompanied by a simple automated test to ensure future changes don't break it. Repeat adding rule after rule until it is fully implemented.

as you read it, you see there area number of things you have to keep track of - how many chips each player has and so on. these will be variables in the game. there are also choices to be made by the player - like bet or fold - these will be input prompts / dialog boxes. There are also rules like the bet amount is always 3 chips. these tell you what the code should do. such as:

if dialog_result()=bet

{

if player_chips<3

{

msg("not enough chips!")

return(FOLD)

}

player_chips-=3

return(BET)

}

it also mentions data you must lookup - the standard poker hands - so to look that up you would of course use a lookup table.

and those are the three basic parts of the program: code, variables, and constant data.

simply go through the description, and for everything it says, go "ok, that means i'll need this and that (some vars or data) , and the code will have to do this and that (implement some rules / behavior)".

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

This topic is closed to new replies.

Advertisement