uchicago-cs / chiventure

A text adventure game engine developed in UChicago's CMSC 22000 - Introduction to Software Development
40 stars 13 forks source link

Fix random_room_lookup iteration bug #760

Closed carolinaecalderon closed 4 years ago

carolinaecalderon commented 4 years ago

In the random_room_lookup function in autogenerate, the idx variable is consistently zero. This means that the room generated is always the room stored at the head of the speclist. The idx variable takes a random number modulo the length of speclist. In order to fix this bug, tests have to be written ensuring the variation of idx value and rand().

carolinaecalderon commented 4 years ago

Minor fix made in https://github.com/uchicago-cs/chiventure/tree/openworld/samples-npcs. I printed out the calls to random_room_lookup() and found that I was indeed getting random room values. The error is not in the function but in the test file. This was an erroneous bug issue, and it is now apparent that the expectations of the functions are being executed appropriately.

dwahme commented 4 years ago

Issue Score: ✔️++

Comments: Great job! Well done with the targeted bug fix.