Question
Black Jack game Using Ruby 1. create a function that generates a random number (between 1 to 10) 2. Call the function in step 1
Black Jack game
Using Ruby
1. create a function that generates a random number (between 1 to 10)
2. Call the function in step 1 twice to generate two random numbers. Store the numbers in an array.
3. Display the number in the array to the user
4. Prompt the user to see if they want another card (random number). If so, append the number in the array in step 2.
5. Repeat step 4 if the sum of the number in the array is below 16 but less than 21. Stop the game if the sum exceed 21.
Please provide your code and screenshot of sample output. no point will be awarded if you did not utilize function, random number generator or arrays in your code.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started