I need some guidance, i havent finished the pseudocode yet
but i quickly (less than 20 mins) wrote some of my ideas, let me know if its a good start or if i should aproach it another way
Code:
/****************************
Present the user interface
Display welcome message
Display options for game
1 Enter ammount of computers to play with
create a class object for each computer
2 Enter ammount of humans to play with
create a class object for each human
3 Start Game
4 Exit
Input option
////////////////////////////////Cards Class///////////////////////////////////
PUBLIC FUNCTIONS:
structure deckType
contains: size of array and an array filled of cardsType
structure for the cardsType
contains: suit
card number
bool type dealt (true if card is dealt to a player)
Create a deck of cards
create a deckType
fill deck with each card
for each card number
create a card for each suit
Shuffle the deck of cards
for many repetitions
choose two random numbers in deck
swap those locations
Deal cards - function takes in: Array of player, and number to deal (X)
choose first X numbers in deck that havent been dealt
check for variables in the array
resize array if necessary
place dealt cards after current variables
mark cards as "dealt" in the deck
Number of cards dealt
go through deck
for each bool dealt = true
add 1 to # cards dealt
return # of cards dealt
______________________________________________________________________________
///////////////////////////////Dealer Class///////////////////////////////////
include cards class
PUBLIC FUNCTIONS:
create a dealer
______________________________________________________________________________
///////////////////////////////Player Class///////////////////////////////////
include cards class
PUBLIC FUNCTIONS:
create a player
______________________________________________________________________________
Deal 2 cards to each player and dealer
Have player 1 go first
after each player
dealers turn
Calculate the winner
if the dealer is the highest
display "You Lose, Dealer Wins!"
if a player has the highest
display "Player X Wins!"
Ask if user would like to play new game, change settings, or exit
******************************/