Create new granule_fill_order
attribute to specify granule allocation preference
#80
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates the
DiskFile
class to have an attribute calledgranule_fill_order
. This list-like object is exactly 68 elements long. Each entry in the list specifies the granule number that should be checked to see if it is empty. The order of the list reflects which granules are allocated first. InDiskConstants
there is a constant calledGRANULE_FILL_ORDER
that mimics the way Disk BASIC attempts to allocate granules on the disk. In general, Disk BASIC attempts to fill granules near the center of the disk first to minimize head stepping. This same ordering is implemented within this PR. The class can be instantiated with a different ordering list, allowing for future customization when generating disk images. Unit tests updated to cover new conditions. This PR closes #73