Chili, maybe god, you, can you lend me some knowledge.
Posted: August 2nd, 2016, 3:50 pm
Conundrum:(C++ Beginner Tutorial 2/homework/LazinessOrEfficiency)
I wrote expression methods for the find and replace feature; trying to be lazy moving all the pixel's x,y values at once. (Spent an hour researching because I believed a way had to exist and might be handy when/if editing repetitive string datasets. It might not be justified in this scenario, but still applicable, AND I JUST WANTED TO LEARN IT GET OFF MY CASE!)
e.g:
gfx.PutPixel(395,300,255,255,255);
gfx.PutPixel(396,300,255,255,255);
Find ((.*?),(.*?),
Replace ($1+300,$2+200,
Result:
gfx.PutPixel(395+300,300+200,255,255,255);
gfx.PutPixel(396+300,300+200,255,255,255);
Gets the job done homework complete. I could just leave it there and call it a day. But it made the strings longer, complex and requires a different expression method to alter the position again. Grave = Dug.
To locate and modify new string format
Find \((.*?)\+300,(.*?)\+200,
Replace ($1,$2,
Now, here's the question. Is there an expression method to make the calculation happen when it replaces the string to move the reticle, instead of my original method where it creates a calculation to move the reticle?
Because god knows my tiny little brain could barely comprehend how to avoid it. It would be nice if that method exists.
Otherwise, I will reset the reticle values to the top left hand side but so it keeps it's shape and use the calculation without going into negative values and remain sane.
Here is who taught me to be lazy. https://msdn.microsoft.com/en-us/library/2k3te2cs.aspx
Also I'm trash tier beginner if I confused you just delete me off the face of the internet fam. I hope I'm using the wrong names for things.
I wrote expression methods for the find and replace feature; trying to be lazy moving all the pixel's x,y values at once. (Spent an hour researching because I believed a way had to exist and might be handy when/if editing repetitive string datasets. It might not be justified in this scenario, but still applicable, AND I JUST WANTED TO LEARN IT GET OFF MY CASE!)
e.g:
gfx.PutPixel(395,300,255,255,255);
gfx.PutPixel(396,300,255,255,255);
Find ((.*?),(.*?),
Replace ($1+300,$2+200,
Result:
gfx.PutPixel(395+300,300+200,255,255,255);
gfx.PutPixel(396+300,300+200,255,255,255);
Gets the job done homework complete. I could just leave it there and call it a day. But it made the strings longer, complex and requires a different expression method to alter the position again. Grave = Dug.
To locate and modify new string format
Find \((.*?)\+300,(.*?)\+200,
Replace ($1,$2,
Now, here's the question. Is there an expression method to make the calculation happen when it replaces the string to move the reticle, instead of my original method where it creates a calculation to move the reticle?
Because god knows my tiny little brain could barely comprehend how to avoid it. It would be nice if that method exists.
Otherwise, I will reset the reticle values to the top left hand side but so it keeps it's shape and use the calculation without going into negative values and remain sane.
Here is who taught me to be lazy. https://msdn.microsoft.com/en-us/library/2k3te2cs.aspx
Also I'm trash tier beginner if I confused you just delete me off the face of the internet fam. I hope I'm using the wrong names for things.