Board index » delphi » Beginner Programming Help

Beginner Programming Help

Hello,

I've just started using Turbo Pascal 7.0 for an introductory computer
science class, and for an assignment we are suppose to write a program for
a game of {*word*99}s...(you roll two dice...  If you get a 7 or an 11 on the
first roll you win; if you get a 2 or a 12 on the first roll, you lose...
Otherwise, the result of the first roll is called your 'point' ...meaning
you continue to roll the dice until you match that point (in which case you
win) or until you roll a 7 (in which case you lose).

  We are to write this program so that it allows the user to place a bet
(on either winning or losing), and continue until the person doesn't want
to play anymore or until he/she runs out of money.  The player is to start
with $100 dollars, and cannot bet less than 0 or more than what the player
has.

I'm sort of stuck, so any kind of help would be greatly appreciated...
Thank you.

Al Masek
ma...@akula.com

 

Re:Beginner Programming Help


Quote
> I've just started using Turbo Pascal 7.0 for an introductory computer
> science class, and for an assignment we are suppose to write a program for
> a game of {*word*99}s...(you roll two dice...  If you get a 7 or an 11 on the
> first roll you win; if you get a 2 or a 12 on the first roll, you lose...
> Otherwise, the result of the first roll is called your 'point' ...meaning
> you continue to roll the dice until you match that point (in which case you
> win) or until you roll a 7 (in which case you lose).

>   We are to write this program so that it allows the user to place a bet
> (on either winning or losing), and continue until the person doesn't want
> to play anymore or until he/she runs out of money.  The player is to start
> with $100 dollars, and cannot bet less than 0 or more than what the player
> has.

> I'm sort of stuck, so any kind of help would be greatly appreciated...
> Thank you.

   I see state that "you're supposed to write this program", so you
shouldn't be offended when I say we don't do homework for students, okay?
That being said, what thought have you given to this problem?  All you've
done here is restated the assignment, so it's difficult to offer any
"help", other than to hand you the working solution - we have little to
work on here.
   You do state that you're using TP7.0, so that's useful information.  
Therefore, I will offer the following hints:

  1. Use Randomize (ONCE, at the start of your program)
  2. Use the Random function.  

   Other than that, you should think about how you want the "game" to
operate...and use the statements you've learned so far to accomplish
something which does that.  It's kinda like building a birdhouse: you
have the raw materials, the tools, and a need; use them to construct the
end result...

Other Threads