Libraryless. Click here for Pure Java version (10285L/57K).
1 | svoid test_MountainsAndValleys { |
2 | new MountainsAndValleys mav; |
3 | mav.values(litdoublearray(1, 5, 3, 4, 5, 5, 2)); |
4 | mav.run(); |
5 | assertEqualsVerbose(ll(1, 4), mav.highs().asList()); |
6 | assertEqualsVerbose(ll(0, 2, 6), mav.lows().asList()); |
7 | |
8 | assertEqualsVerbose(1, mav.next(mav.highs, 0)); |
9 | assertEqualsVerbose(4, mav.next(mav.highs, 01); |
10 | assertEqualsVerbose(-1, mav.next(mav.highs, 4)); |
11 | |
12 | assertEqualsVerbose(-1, mav.prev(mav.lows, 0)); |
13 | assertEqualsVerbose(0, mav.prev(mav.lows, 1)); |
14 | assertEqualsVerbose(0, mav.prev(mav.lows, 2)); |
15 | assertEqualsVerbose(2, mav.prev(mav.lows, 3)); |
16 | assertEqualsVerbose(2, mav.prev(mav.lows, 4)); |
17 | } |
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): mowyntqkapby, mqqgnosmbjvj, wnsclhtenguj
No comments. add comment
Snippet ID: | #1036456 |
Snippet name: | test_MountainsAndValleys (OK) |
Eternal ID of this version: | #1036456/4 |
Text MD5: | acdbc8ff89a697eaa262175da5397488 |
Transpilation MD5: | 7d86fbaacf993a2bb3f27b541d9a7dbd |
Author: | stefan |
Category: | javax / maths |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-12-15 22:39:14 |
Source code size: | 660 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 150 / 212 |
Version history: | 3 change(s) |
Referenced in: | [show references] |