English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Does anyone have a pascal code for the game show deal or no deal even the psuedo cod would be useful

2006-12-19 11:33:46 · 1 answers · asked by ? 2 in Computers & Internet Programming & Design

1 answers

Here is some psuedo code to get you started ..... After you have something a little more defined and need further assistance then ask another question which is a little more specific to a smaller section and function of the code.


Psuedo Code

Create a 26 element array Case() (index 0 to 25)
Create a 26 element array money()

initialize array money() with all prize values

generate a random number 0 to 25
determin if money(rnd) is 0 if so pick another money
using random number load money(rnd) into case and zero its value increment a counter
Use a counter to to keep track of how many cases have been loaded

when all 26 cases randomly loaded goto start of game


start of game

reinitialize the money array with prize values ( use for tote board)

present user with cases 1 through 26 on screen (these equate to the case array index values of 0 to 25)

Create a variable to hold the players first case selection

player chooses a case by picking a case number from screen
remove that case from display subtract 1 to match with array index place that value in case() into caseSelection (this is the players case)

load a variable counter casestopick with number 6
loop using counter
select cases and remove matching money value from tote board



end of loop
make offer

decide deal or no deal

no deal then reload number of cases to pick and loop back to start


You need to make a routine to compute an offer.
Offer subroutine:
Scan tote board array determine Highest, Lowest, and average values. Determine an offer value

return:

2006-12-19 14:12:51 · answer #1 · answered by MarkG 7 · 1 0

fedest.com, questions and answers