CasinoSimulation

Stephen Demeule

December 7, 2014

Overview

This program is now a blackjack game.

Screenshot

Concepts Demonstrated

Recursion

Computer turn is a recursive protocol that will allow the computer to get a score of 16.

Iteration

Player is Iterative, it goes once passes the information and stops.

lists

Had to manipulate and maintain several lists

Object Orientation

Every one of these cards is an object. They need to be treated as such.

External Technology and Libraries

(require games/cards) - this is for card to operate properly. (require racket/gui/base) - used for the message boxes.

Favorite Lines of Code

(define (DealC)

  (set! DealH (append DealH (list (car Deck))) )
  (send Dealer add-card (car Deck) (* (- (length DealH) 1) 73) 0)
  (send Dealer flip-card (car Deck))
  (send (car Deck) user-can-flip #f)
  (send (car Deck) user-can-move #f)
  (set! Deck (cdr Deck))  

) It: Deals the computer (C) a single card from the top the the deck Redefines the deck to everything except the top card Redefines the hand to include the new card shows the card The amount of time it took me to find Set was maddening This small fragment is so pretty in comparison it makes me glad.

Technology Used Block Diagram

This was all done by me.

Additional Remarks

I am really sorry about this. I know it says Casino Simulation, but the other half of this code dropped off My partner no longer wishes to be part of the CS Major (and I do not hold this against him) This means that I had to make a judgement call. Fortunately I had good foresight of being able to plan this The original plan was to have 3 games I took on Black Jack and He was going to Take on Slots and Roulette. Without him instead of trying to spread myself ungodly thin I focused the best I could on Blackjack.