Created
April 21, 2022 06:35
-
-
Save mono0926/cba3c5547296a57ce2735e7fb495cdf6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:test/test.dart'; | |
import 'package:lexicographical_order/lexicographical_order.dart'; | |
void main() { | |
test('Output', () { | |
final first = generateOrderKeys(1).first; | |
print('first: $first'); // a | |
final previous = between(next: first); | |
print('previous: $previous'); // N | |
final next = between(prev: first); // n | |
print('next: $next'); | |
final firstNext = between(prev: first, next: next); // n | |
print('firstNext: $firstNext'); // h | |
// [N, a, h, n] | |
print([first, previous, next, firstNext]..sort()); | |
final value100 = List.generate(100, (index) => index).fold( | |
first, | |
((String result, _) => between(prev: result, next: next)), | |
); | |
// mzzzzzzzzzzzzzzzzzzzn | |
print('value100: $value100'); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment