mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-25 04:15:45 -08:00
Original source downloaded from Vintage Basic
Converted to D by Bastiaan Veelo.
Two versions are supplied that are functionally equivalent, but differ in source layout:
- aceyducey_literal.d
- A largely literal transcription of the original Basic source. All unnecessary uglyness is preserved.
- aceyducey.d
- An idiomatic D refactoring of the original, with a focus on increasing the readability and robustness. Memory-safety is ensured by the language, thanks to the @safe annotation.
Running the code
Assuming the reference dmd compiler:
dmd -run aceyducey.d
Other compilers also exist.
Note that there are compiler switches related to memory-safety (-preview=dip25 and -preview=dip1000) that are not
used here because they are unnecessary in this case. What these do is to make the analysis more thorough, so that with
them some code that needed to be @system can then be inferred to be in fact @safe. [Code that compiles without
these switches is just as safe as when compiled with them]
(https://forum.dlang.org/post/dftgjalswvwfjpyushgn@forum.dlang.org).