Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Matlab function only The double diamond slot machine game has three windows. Each window shows either a double diamond (DD'), a cherry (C), a single

Matlab function only

image text in transcribed

The double diamond slot machine game has three windows. Each window shows either a double diamond (DD'), a cherry (C), a single bar (B), double bar (BB) or triple bar (BBB), or the number seven (7) or a blank (0). There are nine possibilities that need to be accounted for: 7, AB AB AB where AB ANY BAR (i.e., a single, double or triple bar) 8. CCX i.e. two C where X could be either B, BB, BBB, 7 or(0 9. CXX i.e. oneC where X could be either B, BB, BBB, 7 or (0 Cherries result in a payout regardless of what appears with them. The double diamond is wild and can represent any of the other signs to maximize payout Write a function DoubleDiamond to test all possible outcomes given symbols in three windows. The ouput is a 1 x 9 logical array indicating the occurance [three DDs, three 7s, three BBBs, three BBs, three Bs, three Cs, three ABs, two Cs, one C] Restriction: The function DoubleDiamond must use the custom functions written in Part 1 to 8 (should be used either directly, or indirectly when called by another custom function). The custom functions are: AssignNumber, NumberofDoubleDiamonds NumberofCherries, IsOneCherry, IsTwoCherries, IsThreeCherries, IsThreeABs, Is3OneBar, Is3TwoBars, Is3ThreeBars Is3 Sevens and Is3Diamonds For example logicVector = 1x9 logical array The output indicates that DD DD DD is recognized as three DDs, three 7s, three BBBs, three BBs, three Bs, three Cs, and three ABs and not as two Cs, one C. The subfunctions for two Cs exactly two Cs and one C look for exactly one C (DD DD DD is recognized as three Cs) Your Function Save C Reset MATLAB Documentation 1 function vector DoubleDiamond (w1,w2,w3) The double diamond slot machine game has three windows. Each window shows either a double diamond (DD'), a cherry (C), a single bar (B), double bar (BB) or triple bar (BBB), or the number seven (7) or a blank (0). There are nine possibilities that need to be accounted for: 7, AB AB AB where AB ANY BAR (i.e., a single, double or triple bar) 8. CCX i.e. two C where X could be either B, BB, BBB, 7 or(0 9. CXX i.e. oneC where X could be either B, BB, BBB, 7 or (0 Cherries result in a payout regardless of what appears with them. The double diamond is wild and can represent any of the other signs to maximize payout Write a function DoubleDiamond to test all possible outcomes given symbols in three windows. The ouput is a 1 x 9 logical array indicating the occurance [three DDs, three 7s, three BBBs, three BBs, three Bs, three Cs, three ABs, two Cs, one C] Restriction: The function DoubleDiamond must use the custom functions written in Part 1 to 8 (should be used either directly, or indirectly when called by another custom function). The custom functions are: AssignNumber, NumberofDoubleDiamonds NumberofCherries, IsOneCherry, IsTwoCherries, IsThreeCherries, IsThreeABs, Is3OneBar, Is3TwoBars, Is3ThreeBars Is3 Sevens and Is3Diamonds For example logicVector = 1x9 logical array The output indicates that DD DD DD is recognized as three DDs, three 7s, three BBBs, three BBs, three Bs, three Cs, and three ABs and not as two Cs, one C. The subfunctions for two Cs exactly two Cs and one C look for exactly one C (DD DD DD is recognized as three Cs) Your Function Save C Reset MATLAB Documentation 1 function vector DoubleDiamond (w1,w2,w3)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Demystified

Authors: Andrew Oppel

1st Edition

0072253649, 9780072253641

More Books

Students also viewed these Databases questions