diff --git a/rogueviz/nilrider/levels.cpp b/rogueviz/nilrider/levels.cpp index 9b443915..61f8c0dd 100644 --- a/rogueviz/nilrider/levels.cpp +++ b/rogueviz/nilrider/levels.cpp @@ -58,6 +58,32 @@ ld long_x(hyperpoint h) { return h[0] * h[1]; } +ld cycloid(ld x) { + // for x from 0 to TAU, returns y from 0 to 2 + ld alpha = binsearch(0, TAU, [x] (ld a) { + ld ax = a - sin(a); + return ax >= x; + }, 20); + return 1 - cos(alpha); + } + +ld cycloid_wave(ld x) { + /* static bool test = true; + if(test) { + for(ld a=0; a ", res); + return res; + } + ld geodesics_0(hyperpoint h) { ld r = hypot_d(2, h); ld phi = atan2(h[1], h[0]); @@ -808,8 +834,32 @@ level hilbertlev( } ); +level cycloid_slalom( + "Cycloid slalom", 'c', nrlSwapTriangleOrder, + "The main street is a brachistochrone. If you were not moving north/south, " + "it would be the fastest path to get to the goal. Is it still the case " + "in these physics? Definitely not if you have to collect on the way!", + -0.5*dft_block, 2.5*dft_block, 63.5*dft_block, -5.5*dft_block, + { + "gggggggG*GggggrgggggG*GgggggrggggggG*GgggggrggggG*Rgggggrggggggo", + "gggggggGGGggggggggggGGGggggggggggggGGGggggggggggGGGggggggggggggo", + "---------------------------------------------------------------*", + "gggggggggggggGGGgggggggggggGGGggggggggggggGGGggggggggggGGGgggggo", + "ggggggggrggggG*GgggggrgggggG*GggggggrgggggG*GggggrgggggG*Ggggggo", + "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", + "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", + "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", + }, + 0, 2, + brachistochrone, + { + goal{0xFFFFC0, "Collect all triangles in below 1:25, reversing time at most 3 times", basic_check(85, 3)}, + goal{0xFFD500, "Collect all triangles in below 1:10, reversing time at most 3 times", basic_check(70, 3)}, + } + ); + vector all_levels = { - &rotplane, &longtrack, &geodesical, &geodesical4, &heisenberg0, &rotwell, &labyrinth, &obstacle, &spirallev, &hilbertlev + &rotplane, &longtrack, &geodesical, &geodesical4, &heisenberg0, &rotwell, &labyrinth, &obstacle, &spirallev, &hilbertlev, &cycloid_slalom }; }