Hey all,
I got assigned this problem for my homework. I am having so hard time to understand what does she wants me to do in this program.
Anybody who can help me in this?
Here is the problem:
A run is a sequence of adjacent repeated values.
write a program that generates a sequence of 20 random die tosses
(between 1 and 6) in an array and prints the die values, marking
the runs by including them in parentheses, like this
1 2 (5 5) 3 1 2 4 3 (2 2 2 2) 3 6 (5 5) 6 3 1
Use the following pseudocode algorithm:
set a boolean variable inRun to false
For each valid index i in the array
ifinRun
if value[i] is different from the preceding value
print )
inRun=false
if not inRun
if value[i] is the same as the following value
print (
inRun=true
print value[i]
ifinRun
print )