
![Continued... Example: myHand [2 6] sparrowHand= [4 8] deck [6 4 4 8 7 2] winner jackSparrow(myHand, sparrowHand, deck) At the](http://img.homeworklib.com/images/2d0d16d2-f166-43e3-a9c8-5ebb72d565b2.png?x-oss-process=image/resize,w_560)
MATLAB code help!
`Hey,
Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries
function winner = jackSparrow(myHand,sparrowHand,deck)
while true
if sum(myHand)<=11
myHand=[myHand deck(1)];
deck(1)=[];
elseif sum(myHand)>16
break
else
if sum(myHand)<17
if sparrowHand(1)<7 && sparrowHand(1)>1
break
else
myHand=[myHand deck(1)];
deck(1)=[];
end
end
end
end
while sum(sparrowHand)<17
sparrowHand=[sparrowHand deck(1)];
deck(1)=[];
end
if sum(myHand)>21 && sum(sparrowHand)>21
winner='Oh no! We both hornswoggled.';
elseif (sum(myHand)>sum(sparrowHand) &&
sum(myHand)<22)||sum(sparrowHand)>21
winner='Blimey! I win';
elseif (sum(myHand)<=sum(sparrowHand) &&
sum(sparrowHand)<22)||sum(myHand)>21
winner='Jack Sparrow wins.';
end
end
![Command Window myHand [2 61 >sparrowHand=[4 81; >deck=[6 4 4 8 7 2]; winner jackSparrow (myHand, sparrowHand, deck) winner Ja](http://img.homeworklib.com/images/e2454aa6-c7dc-43e6-a5f7-a78022fb3de6.png?x-oss-process=image/resize,w_560)
Kindly revert for any queries
Thanks.
MATLAB code help! Function Name: jackSparrow Inputs: 1. (double) A 1x2 vector describing your hand 2....
Create a simplified Blackjack game using the Deck and Card classes (download the attached files to start). There is also a "TestCard" class that creates a Deck and runs some simple code. You may choose to use this file to help you get started with your game program. 1) Deal 2 cards to the "player" and 2 cards to the "dealer". Print both the player's cards, print one of the dealer's cards. Print the total value of the player's hand. 2) Ask...
How do I start this c++ code homework? Write a code in C++ for a BlackJack card game using the following simplified rules: Each card has a numerical value. Numbered cards are counted at their face value (two counts as 2 points, three, 3 points, and so on) An Ace count as either 1 point or 11 points (whichever suits the player best) Jack, queen and king count 10 points each The player will compete against the computer which represents...
programming language c++
its a project if anyone can help me it's will be
appreciated thnk u.
u have to create a code based on the information im giving
u
you can do it in 1 or 2 day i can wait
1:26 #WW 2.53% Example: A user starts with 1000 points. Game #1 - user chooses to risk 200 points. User wins game (beats the dealer). User now has 1200 points. Game #2 - user chooses to risk 500...
For this assignment you will create a one-player variation of the game BlackJack. The game will be divided into five rounds. The goal of each round is to accumulate a hand of cards that gets as close to 21 without going over. At the beginng of the game you will start with a score of 100 points. After each round, the difference between your hand and 21 will be subtracted from your total score. The object of the entire game...
programming language c++
programming language c++
1:25 #WW # 53% You may, if you wish, work in pairs; this means that a submission may have 2 names attached but those 2 people must have worked on the project. No free rides! The way to submit the program to me is as follows: put the entire program (main and any other functions) into a single compile. Compile it to be sure that you have the correct set of #include statements and...
Use inheritance and classes to represent a deck of playing cards. Create a Cardclass that stores the suit (e.g. Clubs, Diamonds, Hearts, Spades), and name (e.g. Ace, 2, 10, Jack) along with appropriate accessors, constructors, and mutators. Next, create a Deck class that stores a vector of Card objects. The default constructor should create objects that represent the standard 52 cards and store them in the vector. The Deck class should have functions to: • Print every card in the...
Please write the program in python: 3. Design and implement a simulation of the game of volleyball. Normal volleyball is played like racquetball, in that a team can only score points when it is serving. Games are played to 15, but must be won by at least two points. 7. Craps is a dice game played at many casinos. A player rolls a pair of normal six-sided dice. If the initial roll is 2, 3, or 12, the player loses....
Please help me write these in R script / Code 1, Suppose you're on a game show, and you're given the choice of three doors. Behind one door is a car; behind the others, goats. You pick a door, say #1, and the host, who knows what's behind the doors, opens another door, say #3, which has a goat. He then says to you, "Do you want to pick door #2?" What is the probability of winning the car if...
"Blackjack 40" my teacher created this assignment and I need help. He is using c++ and has provided this template: Further instructions are below the template! #include <iostream> #include <cmath> #include <cstdlib> using namespace std; //Will return a number from 1 to 13, representing the face of a card int draw_card() { return rand() % 13 + 1; } int main() { const int BET = 10; //This will allow you to control chance, to make testing easier cout <<...
2 A Game of UNO You are to develop an interactive game of UNO between a number of players. The gameplay for UNO is described at https://www.unorules.com/. Your program should operate as follows. 2.1 Setup 1. UNO cards are represented as variables of the following type: typedef struct card_s { char suit[7]; int value; char action[15]; struct card_s *pt; } card; You are allowed to add attributes to this definition, but not to remove any. You can represent colors by...