This commit is contained in:
Wagyourtail 2022-02-08 11:41:45 -07:00
parent 407f4dbbae
commit bfa644e7a7
No known key found for this signature in database
GPG Key ID: B3A2A4A58244B050
2 changed files with 3 additions and 3 deletions

View File

@ -66,7 +66,7 @@ public interface ActionCosts {
static double[] generateFallNBlocksCost() {
double[] costs = new double[4097];
for (int i = 0; i < 4096; i++) {
for (int i = 0; i < 4097; i++) {
costs[i] = distanceToTicks(i);
}
return costs;

View File

@ -27,9 +27,9 @@ public class ActionCostsTest {
@Test
public void testFallNBlocksCost() {
assertEquals(FALL_N_BLOCKS_COST.length, 4097); // Fall 0 blocks through fall 4096 blocks
for (int i = 0; i < 257; i++) {
for (int i = 0; i < 4097; i++) {
double blocks = ticksToBlocks(FALL_N_BLOCKS_COST[i]);
assertEquals(blocks, i, 0.000000000001); // If you add another 0 the test fails at i=217 LOL
assertEquals(blocks, i, 0.00000000001); // If you add another 0 the test fails at i=989 LOL
}
assertEquals(FALL_1_25_BLOCKS_COST, 6.2344, 0.00001);
assertEquals(FALL_0_25_BLOCKS_COST, 3.0710, 0.00001);