Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

# This is a BASH shell script that simulates drawing dominoes # from a single pool of double six dominoes. # Double six dominoes are

image text in transcribed

image text in transcribed

# This is a BASH shell script that simulates drawing dominoes # from a single pool of "double six" dominoes. # Double six dominoes are dominoes that range from blank (0) # to 6, with two values on each domino There are no duplicate # dominoes. Using a notation in which the value on each side # of the domino is separated by a pipe (|) symbol, the entire # set of double six dominoes consists of the following dominoes: 010 011 012 013 014 015 016 212 213 214 215 216 313 314 315 31 6 414 415 416 515 516 61 6 # The indentation of the dominoes doesn't have any real meaning and # only serves to better show the number of dominoes with each number. # The BASH shell script should check the numberf parameters on the # command line. If there are no parameters on the command line, # the BASH shell script should randomly select 6 dominoes from the pool # of possible dominoes and print those dominoes out to the screen # in the order they were "drawn". The same domino cannot be drawn # more than once. # If there is a single parameter on the command line, the BASH shell # script should read that value in as the number of dominoes to be # drawn. If that number is negative or that number is greater than # 28 (the maximum number of dominoes), the BASH shell script should # display an error and exit. Otherwise, the BASH shell script should # draw the specified number of dominoes, printing them to the screen # in the order drawn. Again, there should be no duplicates. The BASH # shells script should ensure the provided parameters is a number # If there are two parameters on the command line, the first parameter # should specify the number of dominoes to be drawn as specified in the # previous paragraph. The second parameter is the name of a file that # should be overwritten if it already exists or created if it does not # yet exist. The dominoes as they are drawn should be output to this file # in addition to printing them to the screen in the order drawn # This BASH shell script should be well documented and clear written, # using meaningful variable names and clear structure. # This is a BASH shell script that simulates drawing dominoes # from a single pool of "double six" dominoes. # Double six dominoes are dominoes that range from blank (0) # to 6, with two values on each domino There are no duplicate # dominoes. Using a notation in which the value on each side # of the domino is separated by a pipe (|) symbol, the entire # set of double six dominoes consists of the following dominoes: 010 011 012 013 014 015 016 212 213 214 215 216 313 314 315 31 6 414 415 416 515 516 61 6 # The indentation of the dominoes doesn't have any real meaning and # only serves to better show the number of dominoes with each number. # The BASH shell script should check the numberf parameters on the # command line. If there are no parameters on the command line, # the BASH shell script should randomly select 6 dominoes from the pool # of possible dominoes and print those dominoes out to the screen # in the order they were "drawn". The same domino cannot be drawn # more than once. # If there is a single parameter on the command line, the BASH shell # script should read that value in as the number of dominoes to be # drawn. If that number is negative or that number is greater than # 28 (the maximum number of dominoes), the BASH shell script should # display an error and exit. Otherwise, the BASH shell script should # draw the specified number of dominoes, printing them to the screen # in the order drawn. Again, there should be no duplicates. The BASH # shells script should ensure the provided parameters is a number # If there are two parameters on the command line, the first parameter # should specify the number of dominoes to be drawn as specified in the # previous paragraph. The second parameter is the name of a file that # should be overwritten if it already exists or created if it does not # yet exist. The dominoes as they are drawn should be output to this file # in addition to printing them to the screen in the order drawn # This BASH shell script should be well documented and clear written, # using meaningful variable names and clear structure

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

Step: 3

blur-text-image

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

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions

Question

Describe the menstrual cycle in a woman.

Answered: 1 week ago

Question

Explain methods of metal extraction with examples.

Answered: 1 week ago