Skip to content

ncantrell/pic10c

Repository files navigation

pic10c

Spring 2018 PIC10C


Homework Assignment 1

Problems and Problem Solving

I decided to do the version of the assignment which required us to practice using git. Just for fun, I also worked on the custom implementation of "vector".

Solutions and Lessons Learned

This assignment was helpful for practicing operator overloading.

Future Work

There were a couple operators which I wasn't able to fully implement before the deadline. I'd like to go back this summer and finish those.


The mechanics of the game

The game is played with a 'Spanish baraja'.

From the Spanish playing cards entry of wikipedia:

"The traditional Spanish baraja is an old deck that was brought over by the Moors to Spain during the 14th century. The cards are still called naipes after the nā'ib cards found in the Mamluk deck...

Smaller decks have 40 cards and lack ranks 8, 9 and comodines (jokers). The four suits are bastos (clubs), oros (literally "golds", that is, golden coins), copas (cups), and espadas (swords). The four suits are thought to represent the four social classes of the Middle Ages. The suit of coins represents the merchants, the clubs represents the peasants, the cups represent the church and the swords represent the military.

The three face cards of each suit have pictures similar to the jack, queen, and king in the French deck, and rank identically. They are the sota, which is similar to the jack/knave and generally depicts a page or squire, the caballo (knight, literally "horse"), and the rey (king) respectively."

At each round of play the player places a bet. After that, the player and the dealer each draw one card from the deck.The player is then repeatedly asked if another card is wanted. The player can continue to draw cards while the total is less than 7½. After the player's turn is over, the dealer's cards are shown. The dealer's play is always the same: the dealer continues to draw cards only if the total is less than 5½. The value of every card doesn't always agree with the rank of the card. The values are listed in the following table:

Name: As Dos Tres Cuatro Cinco Seis Siete Sota Caballo Rey Rank: 1 2 3 4 5 6 7 10 11 12 Values: 1 2 3 4 5 6 7 ½ ½ ½ For this assignment, assume the player starts with 100 pesos (or dollars) and the game ends when the player is down to 0, or when the dealer loses 900. Also, it is a good idea to add input validation and prevent the user from betting an amount bigger than the one the player actually has.

About

Spring 2018 Pic10c

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages