# # CISC 220, 04s, homework project 1 # # This project has two phases, a first one to satisfy Professor Com Pulsive # and a second one to satisfy Mr. Andre Preneur, CEO of LittleBigStuff, Inc. # # ------------------------------------------------------------------ # Professor Com Pulsive insists that each class has it's own header file # for its declaration and has all it's data fields declared as protected or private. # Each class also has its own .cc file for its member function definitions. # # Phase 1, satisfy Dr. Pulsive: # # Modify card.h so that the rank and suit are protected and a public # member function Rank() returns the rank. Modify war.cc so that it's calls # to c.rank (for a card c) become calls to public member function c.Rank(). # # Take the Player class out of war.cc, and properly construct Player.h and Player.cc. # Modify this Makefile to provide for separate compilation of Player.o. # # Compile, test, and submit this version by February 24. # Submit these files which you will modify: war.cc card.h Makefile, # and these files which you will create: Player.cc Player.h # Note that you make no changes to card.cc in phase 1. # # ------------------------------------------------------------------ # Andre Preneur plans to install the "war" card game in Palm pilots, cell phones, # and other small devices. For this reason he wants the storage of the # cards to be as small as possible. He observes that using two four byte variables # for rank and suit of each card is wasteful. Since there are only 52 cards, # each could be represented by one byte, one char value in the range 0..51, say. # then the rank can be value%13 and suit be value%4. For instance # 19 would represent the 19%13 = 6th rank in the 19%4 = 3rd suit (clubs). # # Also he wants some choice of card players. Let us call the given player type # the random player. Andre wonders how a player that always plays the highest # card in his hand would fare against the random player. # # Phase 2, satisfy Mr. Preneur: # # Modify the card.h so that the protected fields rank and suit are replaced # by a single protected field "card" of type char. Modify the implementation # of the member functions in card.cc so that they work correctly with this new # data representation. # # Compile, test, and submit this version by March 1. # # ------------------------------------------------------------------ # # You have no need to change the Deck or randomInteger stuff, so use those # as found in the course directory. # DS220 = /home/usra/40/16603/220/war war: war.o card.o g++ war war.o card.o $(DS220)/deck.o $(DS220)/randomInteger.o card.o: card.cc card.h g++ card.cc -c war.o: war.cc card.h g++ war.cc -c