Question: A run is a sequence of adjacent repeated values. Write a Go program that generates a sequence of 2 0 random die tosses in an
A run is a sequence of adjacent repeated values.
Write a Go program that generates a sequence of random die tosses in an arrayslice and that prints the die values, marking the runs by including them in parentheses, like this:
Hint: look into the Go mathrand package for functions to help complete this exercise.
You can use the following pseudocode:
inRun false
For each valid index i in the array
If inRun
If valuesi is different from the preceding value
Print
inRun false
If not inRun
If valuesi is the same as the following value
Print
inRun true
Print valuesi
If inRun, print Write in GO be sure to test before submitting
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
