Skip to content

Add a Value type to represent a value in RAM#6

Merged
RandomSearch18 merged 3 commits intomasterfrom
custom-value-type
Feb 26, 2025
Merged

Add a Value type to represent a value in RAM#6
RandomSearch18 merged 3 commits intomasterfrom
custom-value-type

Conversation

@RandomSearch18
Copy link
Owner

@RandomSearch18 RandomSearch18 commented Feb 26, 2025

This does add quite a bit of complexity to the program, but it was a nice way to learn more about rust traits and things, and it also means that wrapping (to keep values within -999..999) is guaranteed to work properly when adding and subtracting numbers.

In the future, this new stuct could make it easier to support different word lengths for the CPU, e.g. to make it a 16-bit or 32-bit CPU. Or this PR may have made that much harder for myself. I'm not quite sure yet.

@RandomSearch18 RandomSearch18 merged commit 7ea838f into master Feb 26, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant