reset password
Author Message
Amedrano
Posts: 80
Posted 23:56 Oct 19, 2015 |

So I'm a little unsure of what part 1 of lab3 wants from us exactly.  Can anyone explain the instructions or give a sample output?

For part 2 are we to create our own unique rackunit tests?

waaffles
Posts: 16
Posted 00:02 Oct 20, 2015 |
You need to create a list that holds the game with the greatest secret number, and one for the lowest secret number. As that number changes, so should your list. You put the first game in each as a base. If afterwards you get a game with a higher secret number, you should replace the base game with the new one, same for the list with the smallest secret number. The approach is similar to that in the lecture notes, which is done recursively.
Amedrano
Posts: 80
Posted 00:04 Oct 20, 2015 |
waaffles wrote:
You need to create a list that holds the game with the greatest secret number, and one for the lowest secret number. As that number changes, so should your list. You put the first game in each as a base. If afterwards you get a game with a higher secret number, you should replace the base game with the new one, same for the list with the smallest secret number. The approach is similar to that in the lecture notes, which is done recursively.

so in these new lists we are creating, is there only one game in them at all times?

Last edited by Amedrano at 00:08 Oct 20, 2015.
ahnman341
Posts: 22
Posted 10:09 Oct 20, 2015 |
Amedrano wrote:
waaffles wrote:
You need to create a list that holds the game with the greatest secret number, and one for the lowest secret number. As that number changes, so should your list. You put the first game in each as a base. If afterwards you get a game with a higher secret number, you should replace the base game with the new one, same for the list with the smallest secret number. The approach is similar to that in the lecture notes, which is done recursively.

so in these new lists we are creating, is there only one game in them at all times?

two cases

1.  if there are multiple games with the same game-secret-number, the new list will contain all games instances with the same game-secret-number

2.  otherwise, there is only one game in the new list

Last edited by ahnman341 at 10:09 Oct 20, 2015.