eternaldensity / Sandcastle-Builder

xkcd: 1190: Time: The Game
Other
79 stars 65 forks source link

Fix another mistake in NextLegal #1387

Closed pickten closed 8 years ago

EPSIL0N commented 8 years ago

I think we need to set out what behavior we are trying to get NextLegal to perform as the change in the first commit here disagrees with what I was predicting in my head.

pickten commented 8 years ago

NextLegal should just be able to iterate over all NPs. The bug here was that it wasn't in a sensible order, going outwards when it would make more sense to just start at the smallest possible NP and move up. So instead of going 1, 2, 3, ... max as before, it now goes -max, -max+0.1, -max+1, -max+1.1, ..., max

EPSIL0N commented 8 years ago

I'll have to test it more but I think this will only work for positives as I'm pretty sure if you give it a negative it returns a positive + a fractal step because of the absolute still being included while the sign was removed.

eternaldensity commented 8 years ago

So... I'll hold off on pulling this?

EPSIL0N commented 8 years ago

As far as I can tell there are still issues. flipit: positive with fractals is not working, goes from 3.1 to -2.9 for example.

NextLegal: as far as I know the pattern breaks down around 0 as I believe we are not using 0.1 or -0.1. I know what it used to do but I don't know what we need it to do now. I was looking into writing a futureproof version once I know how it is supposed to act.

Display change should work.

pickten commented 8 years ago

The flipit and display bugs were what I tried to fix in the latter two commits. Are those actually fixed, or are they still wrong with the fixes?

EPSIL0N commented 8 years ago

The display bug fix looks like it will work.

As far as I know flipit is still wrong, from my understanding NP distances are measured in absolute distance from NP 0 so the pairs should be identical but with opposite sign such as 13.1 and -13.1, this version works for negative to positive (ex -13.1 becomes 14 + -0.9 = 20.1) but for positive to negative 13.1 becomes -13 + 0.1 = -12.9)

EPSIL0N commented 8 years ago

Refix is still giving me an error. The first floor causes negatives with a frac to become larger and positives to become smaller. -11.1 to -12 & 11.1 to 11. The frac is added on properly at the end tho but for example -11.1 returns 12.1.

Am I correct in the assumption we are taking the number apart because simply multiplying by -1 causes issues?

EPSIL0N commented 8 years ago

Okay, so I think flipit is good now, are you still looking at NextLegal or may I?

pickten commented 8 years ago

Go ahead. I'll look into some of the other bugs in the meanwhile.

pickten commented 8 years ago

I added a few more bugfixes/miscellanea to solve a couple minor issues and make splosion and pInsanity a bit easier on the player.

EPSIL0N commented 8 years ago

very nice.