Discussion:
Shuffle not working?
(too old to reply)
Ryan
2010-06-10 21:24:52 UTC
Permalink
The code for shuffle
http://www.student.cs.uwaterloo.ca/~cs246/SE/Assignments/P1/code/shuffle

has no input (no deck, or DECK_SIZE), also it there is no #include
"Card.h" so it has no clue what Card is (it uses Card * c).

In addition, the assignment has no mention of if deck[0] or
deck[DECK_SIZE -1] is the "top" and "bottom" of the deck. This is
important if you want the cards to have the same results to being shuffled.

As well I have renamed it to shuffle.cpp because it has no file
extension, was I correct to do so or was this intended?
Joanne Atlee
2010-06-11 19:53:39 UTC
Permalink
shuffle() isn't a module that you can simply link into your
implementation. It is an algorithm/function for you to incorporate into
your own modules. You are free to change the code to fit with your
declarations (e.g., maybe you don't have a DECK_SIZE).


With respect to deck[0] -- good catch. deck[0] is the top of the deck.


Jo
Post by Ryan
The code for shuffle
http://www.student.cs.uwaterloo.ca/~cs246/SE/Assignments/P1/code/shuffle
has no input (no deck, or DECK_SIZE), also it there is no #include
"Card.h" so it has no clue what Card is (it uses Card * c).
In addition, the assignment has no mention of if deck[0] or
deck[DECK_SIZE -1] is the "top" and "bottom" of the deck. This is
important if you want the cards to have the same results to being shuffled.
As well I have renamed it to shuffle.cpp because it has no file
extension, was I correct to do so or was this intended?
Loading...