Fully working 2 array version

memcpy() sucks
This commit is contained in:
A.M. Rowsell 2023-05-29 05:49:14 -04:00
commit aa99670084
Signed by: amr
GPG key ID: 0B6E2D8375CF79A9
2 changed files with 105 additions and 16 deletions

View file

@ -8,12 +8,14 @@ later, and so here we are.
Written in C because Python would probably have been too easy. Was considering
doing it in C++ so I could take advantage of classes.
Going to try and figure out how to do the "modify in-place" algorithm instead
of the easy way using 2 arrays that you ping-pong between. Still unclear how
you can modify it in-place without destroying information you need when
processing cells further along... have to give it a good think. I mean, I
assume there's a way to do it because this programming website set it as
a challenge.
Currently it uses the 2 array algorithm, copying to a temporary array to process
and then copying back after.
Going to try and figure out how to do the "modify in-place" algorithm instead.
Still unclear how you can modify it in-place without destroying information
you need whenprocessing cells further along... have to give it a good think.
I mean, I assume there's a way to do it because this programming website set
it as a challenge.
Licensed under the Mozilla Public License v2.0 like pretty much all of my
code is. Feel free to use it or study it for whatever purpose.