reset password
Author Message
303496263
Posts: 68
Posted 18:18 Jan 09, 2015 |

Hi there. 

Quote from the instructions:

Keep rolling on the computer's turn until it has accumulated 20 or more points, then hold.
Of course, if the computer wins or rolls a 1 then the turn ends immediately 

Does this mean we should keep rolling until we hit 20 points mark for the current roll and then hold immediately, or we could keep rolling at our own discretion for the computer which could actually make it(computer) lose intentionally?

Thank you.

 

Last edited by 303496263 at 18:19 Jan 09, 2015.
kknaur
Posts: 540
Posted 19:46 Jan 09, 2015 |

The computer will keep rolling until it gets 20 or more points, or until it rolls a 1 and loses the turn.  Whichever happens first.

303496263
Posts: 68
Posted 20:19 Jan 09, 2015 |

Thank your for the quick answer.

One more quick point here as well.

By "keep rolling on computers turn" do we manually roll for the computer or set it up so that it runs automatically?

Thank you!

 

 

 

 

kknaur
Posts: 540
Posted 09:50 Jan 10, 2015 |

The computer's turn should happen automatically.  The computer will always choose to roll again unless it gets 20 or more points and it will hold, or it will roll a 1 and lose the turn.

303496263
Posts: 68
Posted 13:52 Jan 10, 2015 |

Thank you!

G190852562
Posts: 162
Posted 23:36 Jan 10, 2015 |

So the instruction says:

Keep rolling on the computer's turn until it has accumulated 20 or more points, then hold.

Does this mean that it'll never roll again (since its points will always stay at 20 or more)? 

Of course, if the computer wins or rolls a 1 then the turn ends immediately.

When the computer reaches 100 or more points, right?

I think I might need an example of how this program works. In terms of the computer's side.

 

Last edited by G190852562 at 23:42 Jan 10, 2015.
navery
Posts: 7
Posted 11:35 Jan 12, 2015 |

I have a question along these lines: The instruction says:
Write a version of this game, to be played against the computer. The computer program should play according
to the following rule: Keep rolling on the computer's turn until it has accumulated 20 or more points, then hold.
Of course, if the computer wins or rolls a 1 then the turn ends immediately. Allow the human player to roll first.

To me, this implies that once the computer's score has reached at least 20, then the computer's turn will only simulate 1 roll for each turn. For instance, if the computer has been rolling, and reaches 23, then the user rolls. Once the user is finished rolling, and it is once again the computer's turn, NO MATTER WHAT THE COMPUTER ROLLS, THE CUMULATIVE SCORE WILL ALWAYS BE >= 20, so that implies that only one roll should be allowed for each turn that the computer uses once it has reached 20 points. Is this correct?

Or should it be EACH turn that the computer takes should have a maximum of 20 points. In other words, a computer can keep rolling until it scores 20 points in a turn.

Which should it be? The instructions imply that we are limiting the computer's rolls to it's cumulative score, but intuitively I am thinking that the instructions are meant to limit the computer's rolls to 20 point intervals. Please correct my misunderstandings here. Thanks

rkmx52
Posts: 23
Posted 12:18 Jan 12, 2015 |
navery wrote:

I have a question along these lines: The instruction says:
Write a version of this game, to be played against the computer. The computer program should play according
to the following rule: Keep rolling on the computer's turn until it has accumulated 20 or more points, then hold.
Of course, if the computer wins or rolls a 1 then the turn ends immediately. Allow the human player to roll first.

To me, this implies that once the computer's score has reached at least 20, then the computer's turn will only simulate 1 roll for each turn. For instance, if the computer has been rolling, and reaches 23, then the user rolls. Once the user is finished rolling, and it is once again the computer's turn, NO MATTER WHAT THE COMPUTER ROLLS, THE CUMULATIVE SCORE WILL ALWAYS BE >= 20, so that implies that only one roll should be allowed for each turn that the computer uses once it has reached 20 points. Is this correct?

Or should it be EACH turn that the computer takes should have a maximum of 20 points. In other words, a computer can keep rolling until it scores 20 points in a turn.

Which should it be? The instructions imply that we are limiting the computer's rolls to it's cumulative score, but intuitively I am thinking that the instructions are meant to limit the computer's rolls to 20 point intervals. Please correct my misunderstandings here. Thanks

The computer can roll more than once per turn. It's impossible for the computer to reach 20 points in a single roll since a 6-sided dice is used (the maximum points you can get in a single roll is 6). 

The computer is like a greedy gambler. It'll keep rolling until it accumulates up to 20 points, at which point it will decide to 'Hold' and store the points into the scoreboard. If however, during any of these rolls, the computer rolls a 1, then the computer will forfeit the turn (due to the rules of the game) and store 0 points into the scoreboard.

navery
Posts: 7
Posted 12:58 Jan 12, 2015 |
rkmx52 wrote:
navery wrote:

I have a question along these lines: The instruction says:
Write a version of this game, to be played against the computer. The computer program should play according
to the following rule: Keep rolling on the computer's turn until it has accumulated 20 or more points, then hold.
Of course, if the computer wins or rolls a 1 then the turn ends immediately. Allow the human player to roll first.

To me, this implies that once the computer's score has reached at least 20, then the computer's turn will only simulate 1 roll for each turn. For instance, if the computer has been rolling, and reaches 23, then the user rolls. Once the user is finished rolling, and it is once again the computer's turn, NO MATTER WHAT THE COMPUTER ROLLS, THE CUMULATIVE SCORE WILL ALWAYS BE >= 20, so that implies that only one roll should be allowed for each turn that the computer uses once it has reached 20 points. Is this correct?

Or should it be EACH turn that the computer takes should have a maximum of 20 points. In other words, a computer can keep rolling until it scores 20 points in a turn.

Which should it be? The instructions imply that we are limiting the computer's rolls to it's cumulative score, but intuitively I am thinking that the instructions are meant to limit the computer's rolls to 20 point intervals. Please correct my misunderstandings here. Thanks

The computer can roll more than once per turn. It's impossible for the computer to reach 20 points in a single roll since a 6-sided dice is used (the maximum points you can get in a single roll is 6). 

The computer is like a greedy gambler. It'll keep rolling until it accumulates up to 20 points, at which point it will decide to 'Hold' and store the points into the scoreboard. If however, during any of these rolls, the computer rolls a 1, then the computer will forfeit the turn (due to the rules of the game) and store 0 points into the scoreboard.

No, this is not what I mean. First off, When I say "turn", I mean "Round, or TURNS". For example, when it's player 1's "TURN", they can keep rolling as long as they don't roll a 1. I don't mean that "turn" == 1 roll.

You said: It's impossible for the computer to reach 20 points in a single roll since a 6-sided dice is used (the maximum points you can get in a single roll is 6).

But I never said that the computer can roll a 20 on 1 ROLL. Your reply doesn't have anything to do with my question.

My question, if I can put it any more simpler, is as follows:

 

Consider once again that player 1 has rolled a 4, and then a 1. It would then be the computer's "TURN"... say the computer rolled a 6 FOUR TIMES. The computer's score would then be 24. It would then choose to hold, and once again it's player 1's turn.

Player 1 then rolls a 1. Now again it's the computer's turn. HERE IS WHERE THE QUESTION LIES. The computer already has more than 20. So does the computer now only roll 1 time from here on out, since no matter what the result of the next roll, the computer will STILL HAVE MORE THAN 20 points(cumulatively). OR........

Is the computer allowed to roll as much as possible on its "turn"? (remember, here "turn" does not mean 1 roll, but a turn to roll as many times before rolling a 1 or up to 20)

In other words, does this limiting rule of only rolling up to 20 apply to the CUMULATIVE SCORE, or just the score per turn/round?

Literal application of the assignment's instructions imply that the 20 point limit applies to the cumulative score, but like I said, intuitively I suspect that this limit is to be applied to the score within each "turn". But I want the final answer so that my program is according to specs.

whew.... that was a mouthful. This post is for the instructor to answer, as the instructions are from him. Other students, please only reply if you have the answer from the instructor himself. thanks.

jwarren6
Posts: 56
Posted 13:18 Jan 12, 2015 |

It seems to me that you do know the distinction between a roll and a turn. Therefore, your answer is literally in the instructions, namely:

    Keep rolling on the computer's turn until it has accumulated 20 or more points, then hold.

This means that your program loops during the computer's turn until you have accumulated 20 or more points and then end the turn AND add the turn score to the total score. Of course, if the roll comes up a 1, you immediately end the turn and the total score remains the same.

navery
Posts: 7
Posted 14:31 Jan 12, 2015 |
jwarren6 wrote:

It seems to me that you do know the distinction between a roll and a turn. Therefore, your answer is literally in the instructions, namely:

    Keep rolling on the computer's turn until it has accumulated 20 or more points, then hold.

This means that your program loops during the computer's turn until you have accumulated 20 or more points and then end the turn AND add the turn score to the total score. Of course, if the roll comes up a 1, you immediately end the turn and the total score remains the same.

Your explanation is indeed what I suspect to do. But the confusion comes in the literal translation of "until is has accumulated 20 or more points".

You see, if the computer was able to accumulate 20+ points from previous turns, then it has already accumulated the 20 points. So if taken literally, on each new turn, if the computer has already accumulated a cumulative score of 20+ points, the computer would only roll once per new turn and then hold. Do you see what the LITERAL implications of that sentence are?

I better sentence in the instructions would be something like:

For each new turn that the computer has, the computer will roll until either a 1 has been rolled, or a score of 20+ points has been rolled FOR THAT TURN, (regardless of the cumulative score).

I am assuming that this is what we need to do, but you know what happens when assumptions are made, so I just wanted to know explicitly what the professor wants us to do.

Keenan???